8000 Simple Task Management App · anshi-the-coder/Javascript@6304789 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6304789

Browse files
Simple Task Management App
1 parent fe6bbc2 commit 6304789

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
display: flex;
4+
justify-content: center;
5+
align-items: center;
6+
height: 100vh;
7+
background-color: #ddff;
8+
}
9+
.container {
10+
background: white;
11+
padding: 20px;
12+
border-radius: 10px;
13+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
14+
width: 300px;
15+
text-align: center;
16+
}
17+
input {
18+
width: 80%;
19+
padding: 8px;
20+
}
21+
button {
22+
padding: 8px;
23+
cursor: pointer;
24+
margin-top: 10px;
25+
}
26+
button {
27+
padding: 8px;
28+
cursor: pointer;
29+
margin-top: 10px;
30+
}
31+
ul {
32+
list-style: none;
33+
padding: 0;
34+
}
35+
li {
36+
background: #ddd;
37+
margin: 5px 0;
38+
padding: 8px;
39+
display: flex;
40+
justify-content: space-between;
41+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
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>Task Management App</title>
7+
<link rel="stylesheet" href="index.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<h2>Task Management App</h2>
12+
<input type="text" id="task" placeholder="Add a new task">
13+
<!-- <input type="text" id="task" placeholder="Create a new task"> -->
14+
<button onclick="addTask()">Add</button>
15+
<button onclick="completeTask()">Complete</button>
16+
<button onclick="incompleteTask()">Incomplete</button>
17+
<ul id="taskList"></ul>
18+
</div>
19+
<script src="index.js"></script>
20+
</body>
21+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function addTask() {
2+
let taskInput = document.getElementById("task");
3+
let taskValue = taskInput.value.trim();
4+
if (taskValue === "") return;
5+
6+
let li = document.createElement("li");
7+
li.innerHTML = `${taskValue} <button onclick="removeTask(this)">X</button>`;
8+
document.getElementById("taskList").appendChild(li);
9+
taskInput.value = "";
10+
}
11+
12+
function removeTask(btn) {
13+
btn.parentElement.remove();
14+
}

0 commit comments

Comments
 (0)
0