回答編集履歴
1
コード修正
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```js
|
2
2
|
$(document).on("click", "li button", function (){
|
3
|
-
$(this).parent().remove(); //ここで削除しているで、
|
3
|
+
$(this).parent().remove(); //ここで親と一緒に削除しているで、
|
4
4
|
let remove_index = $('li.count_li').index($(this).parent()); //この時点でthisは存在していない
|
5
5
|
console.log(remove_index);
|
6
6
|
localStorage.removeItem(`save_task${remove_index}`);
|