|
1 | | -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en"> |
3 | | -<head> |
4 | | - <meta charset="UTF-8" /> |
5 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
6 | | - <title>ToDo List</title> |
7 | | - <link rel="stylesheet" href="style.css" /> |
8 | | - <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <title>ToDo List</title> |
| 7 | + <link rel="stylesheet" href="style.css" /> |
| 8 | + <link |
| 9 | + href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" |
| 10 | + rel="stylesheet" |
| 11 | + /> |
9 | 12 |
|
10 | | - <script type="module" src="script.mjs"></script> |
11 | | -</head> |
12 | | -<body> |
13 | | - <div class="todo-container"> |
14 | | - <h1>My ToDo List</h1> |
| 13 | + <script type="module" src="script.mjs"></script> |
| 14 | + </head> |
| 15 | + <body> |
| 16 | + <div class="todo-container"> |
| 17 | + <h1>My ToDo List</h1> |
15 | 18 |
|
16 | | - <div class="todo-input"> |
17 | | - <input type="text" id="new-task-input" placeholder="Enter a new task..." /> |
18 | | - <button id="add-task-btn">Add</button> |
19 | | - </div> |
| 19 | + <div class="todo-input"> |
| 20 | + <input |
| 21 | + type="text" |
| 22 | + id="new-task-input" |
| 23 | + placeholder="Enter a new task..." |
| 24 | + /> |
| 25 | + <button id="add-task-btn">Add</button> |
| 26 | + <button id="delete-completed-btn">Delete completed</button> |
| 27 | + </div> |
20 | 28 |
|
21 | | - <ul id="todo-list" class="todo-list"> |
22 | | - </ul> |
| 29 | + <ul id="todo-list" class="todo-list"></ul> |
23 | 30 |
|
24 | | - <!-- |
| 31 | + <!-- |
25 | 32 | This is a template for the To-do list item. |
26 | 33 | It can simplify the creation of list item node in JS script. |
27 | 34 | --> |
28 | | - <template id="todo-item-template"> |
29 | | - <li class="todo-item"> <!-- include class "completed" if the task completed state is true --> |
30 | | - <span class="description">Task description</span> |
31 | | - <div class="actions"> |
32 | | - <button class="complete-btn"><span class="fa-solid fa-check" aria-hidden="true"></span></button> |
33 | | - <button class="delete-btn"><span class="fa-solid fa-trash" aria-hidden="true"></span></button> |
34 | | - </div> |
35 | | - </li> |
36 | | - </template> |
37 | | - |
38 | | - </div> |
39 | | -</body> |
| 35 | + <template id="todo-item-template"> |
| 36 | + <li class="todo-item"> |
| 37 | + <!-- include class "completed" if the task completed state is true --> |
| 38 | + <span class="description">Task description</span> |
| 39 | + <div class="actions"> |
| 40 | + <button class="complete-btn"> |
| 41 | + <span class="fa-solid fa-check" aria-hidden="true"></span> |
| 42 | + </button> |
| 43 | + <button class="delete-btn"> |
| 44 | + <span class="fa-solid fa-trash" aria-hidden="true"></span> |
| 45 | + </button> |
| 46 | + </div> |
| 47 | + </li> |
| 48 | + </template> |
| 49 | + </div> |
| 50 | + </body> |
40 | 51 | </html> |
0 commit comments