Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions ujjwal-demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple To-Do List</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f4f4f9;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
background: #fff;
padding: 20px 25px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
width: 300px;
}

h2 {
text-align: center;
color: #333;
}

input {
width: 100%;
padding: 8px;
margin-top: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}

ul {
list-style: none;
padding: 0;
margin-top: 15px;
}

li {
background: #f0f0f0;
margin-bottom: 8px;
padding: 8px;
border-radius: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}

button {
background: crimson;
color: white;
border: none;
border-radius: 4px;
padding: 4px 8px;
cursor: pointer;
}

button:hover {
background: darkred;
}
</style>
</head>

<body>
<div class="container">
<h2>📝 To-Do List</h2>
<input type="text" id="taskInput" placeholder="Add new task...">
<ul id="taskList"></ul>
</div>

<script>
const input = document.getElementById('taskInput');
const list = document.getElementById('taskList');

input.addEventListener('keypress', function (e) {
if (e.key === 'Enter' && input.value.trim() !== '') {
const li = document.createElement('li');
li.textContent = input.value;
const btn = document.createElement('button');
btn.textContent = '❌';
btn.onclick = () => li.remove();
li.appendChild(btn);
list.appendChild(li);
input.value = '';
}
});
</script>
</body>

</html>