HTML
CSS
JS
index.html
AI Review
Reset
<h1>My To-Do List</h1> <p>Tasks remaining: <span id="task-count">0</span></p> <div class="input-row"> <input id="task-input" type="text" placeholder="What needs doing?"> <button id="add-btn">Add</button> </div> <ul id="task-list"></ul>
body { font-family: sans-serif; max-width: 480px; margin: 40px auto; padding: 20px; } .input-row { display: flex; gap: 8px; margin: 16px 0; } #task-input { flex: 1; padding: 10px; font-size: 16px; } #add-btn { padding: 10px 16px; font-size: 16px; cursor: pointer; } #task-list { list-style: none; padding: 0; } #task-list li { padding: 10px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; cursor: pointer; } #task-list li.complete { text-decoration: line-through; color: #9ca3af; } .delete-btn { margin-left: auto; background: #ef4444; color: white; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
// Build your to-do app here // Tip: store tasks in an array and render from it
Live Preview