-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO.html
46 lines (40 loc) · 867 Bytes
/
TODO.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>TODO</title>
<style>
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
}
#input {
margin-bottom: 8pt;
padding: 4pt;
}
#add {
border: 0px solid #0000;
padding: 4pt;
margin-left: 8pt;
}
</style>
<div id="app"></div>
<script src="elite.js"></script>
<script>
const addTask = (e) => {
e.preventDefault();
const task = get('input').value
if (!task) return
input.value = ''
add('list', el('p', task))
}
set('app', [
el('h1', 'TODO'),
el('form', {}, { submit: addTask }, [
el('input', { id: 'input', type: 'text', placeholder: 'Enter task', required: true, autofocus: true }),
el('button', 'Add', { id: 'add', type: 'submit' })
]),
el('div', { id: 'list' }),
])
</script>