mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
day 1 exercise updates
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
<body>
|
||||
<header>
|
||||
<h1>todos</h1>
|
||||
<div class="addTodo">
|
||||
<form onsubmit="return addTodo()" class="addTodo">
|
||||
<input class="textfield" placeholder="add todo" />
|
||||
<button onclick="addTodo()" class="submit">Add</button>
|
||||
</div>
|
||||
<button class="submit">Add</button>
|
||||
</form>
|
||||
<nav class="filter">
|
||||
<button onclick="filter('all', this)" class="selected">all</button>
|
||||
<button onclick="filter('active', this)">active</button>
|
||||
@@ -52,7 +52,8 @@
|
||||
remaining.innerText = todos;
|
||||
}
|
||||
|
||||
function addTodo() {
|
||||
function addTodo(ev) {
|
||||
console.log('hello');
|
||||
const todo = document.querySelector('.todo');
|
||||
const newTodo = todo.cloneNode(true);
|
||||
newTodo.querySelector('.title').innerText = getTodoText();
|
||||
|
||||
Reference in New Issue
Block a user