回答編集履歴
1
調整
test
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
```javascript
|
2
2
|
|
3
|
-
|
3
|
+
deleteButton.addEventListener('click', (e) => {
|
4
4
|
|
5
|
-
|
5
|
+
var t=e.target.closest('tr');
|
6
6
|
|
7
|
-
|
7
|
+
var idx=[...tableBody.querySelectorAll('tr')].indexOf(t);
|
8
8
|
|
9
|
-
|
9
|
+
t.parentNode.removeChild(t);
|
10
10
|
|
11
|
-
|
11
|
+
todos.splice(idx,1);
|
12
12
|
|
13
|
-
console.log(todos);
|
14
|
-
|
15
|
-
|
13
|
+
});
|
16
14
|
|
17
15
|
```
|