-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
40 lines (39 loc) · 1.16 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" , initial-scale="1.0" />
<title>To Do List</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<section class="header"></section>
<h1>To Do List</h1>
<input type="text" id="newTask" placeholder="Add new task to do" />
<input type="button" value="add task" id="add" onclick="newTask()" />
<input
type="button"
value="reset task list"
id="add"
onclick="deleteTaskList()"
/>
<div id="tasks" class="taskList"></div>
<script src="index.js"></script>
<script src="jquery-3.6.1.js"></script>
<script>
//add and remove <s></s> tags on click
$(function () {
var $curParent, Content;
$(document).delegate("span", "click", function () {
if ($(this).closest("s").length) {
Content = $(this).parent("s").html();
$curParent = $(this).closest("s");
$(Content).insertAfter($curParent);
$(this).closest("s").remove();
} else {
$(this).wrapAll("<s />");
}
});
});
</script>
</body>
</html>