-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.ejs
64 lines (54 loc) · 2 KB
/
home.ejs
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<title>
<%= locals.title %>
</title>
<style>
body{
text-align: center;
}
</style>
<script src="https://kit.fontawesome.com/35a525ecbe.js"></script>
<link rel="stylesheet" href="./home.css">
</head>
<body>
<div id="app">
<h1>TODO App</h1>
<form action="/" method="POST">
<p>DESCRIPTION</p>
<input type="text" name="description" placeholder="What do you want to do?" required>
<div id="category">
<p>CATEGORY</p>
<select id="select">
<option value="default" name="category">Choose a category</option>
</select>
<label for="" name="date">DUE DATE</label>
<input type="date" name="date" id="date">
</div>
<button type="submit"><i class="fas fa-plus"></i>ADD TASK</button>
<BUtton type="submit"><i class="fas fa-trash-alt"></i>DELETE TASK </BUtton>
</form>
<div id="list_all">
<ul>
<% for(let i of LIST){%>
<p><%= i.description %></p>
<p><%= i.category %></p>
<p><%= i.date %></p>
<%}%>
</ul>
</div>
</div>
<script>
var select = document.getElementById("select"),
arr = ["Personal","Work","School","Others"];
for (var i=0; i< arr.length; i++)
{
var option = document.createElement("option"),
txt = document.createTextNode(arr[i]);
option.appendChild(txt);
option.setAttribute("value",arr[i]);
select.insertBefore(option,select.lastChild);
}
</script>
</body>
</html>