-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
47 lines (37 loc) · 1.2 KB
/
script.js
File metadata and controls
47 lines (37 loc) · 1.2 KB
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
47
var n = 0;
function button(){
n = n+1;
var div = document.createElement("div");
var task = document.getElementById("task");
var todo = document.getElementById("todo");
var space = document.createElement("p");
var para = document.createTextNode(todo.value);
var headin = document.createTextNode(task.value);
var del = document.createElement("button");
del.innerText = "delete"
del.setAttribute("id","dele");
del.setAttribute("class","fa fa-trash")
div.setAttribute("id","tobe");
div.style.width = "300px";
div.style.padding = "10px";
div.style.fontSize = "25px"
div.style.height = "400px";
div.style.background = "rgb(85, 0, 255)";
div.style.color = "white";
div.style.margin = "10px";
div.style.borderRadius = "12px";
div.appendChild(headin);
div.appendChild(space);
div.appendChild(para);
div.appendChild(del);
div.style.float = "left";
task.value="";
todo.value="";
var dvv = document.getElementById("tobe");
function delte(){
div.parentElement.removeChild(div);
}
document.getElementById("main").appendChild(div);
del.addEventListener("click", delte);
var g = 10
}