-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
41 lines (37 loc) · 802 Bytes
/
server.js
File metadata and controls
41 lines (37 loc) · 802 Bytes
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
let task=[{
todo:'work',
strike:true
}]
function main(){
console.log(task.length)
let html=''
for(let i=0;i<task.length ;i++)
{
if(task[i].strike)
{
html+=`<li class="strike">${task[i].todo}</li>`
}
else{
html+=`<li>${task[i].todo}</li>`
}
}
return html
}
function paint(){
const ol=document.getElementById('ol')
ol.innerHTML=main(task)
input.value=''
}
window.onload=function(){
console.log('kk')
const button=document.getElementById('button')
button.addEventListener('click',function(){
const input=document.getElementById('input')
task.push({
todo:input.value,
strike:false
})
console.log(task)
paint()
})
}