回答編集履歴

1

chousei

2021/05/21 11:13

投稿

yambejp
yambejp

スコア116724

test CHANGED
@@ -1,6 +1,16 @@
1
1
  ```javascript
2
2
 
3
+ <button class="A B C">btn</button>
4
+
5
+ <script>
6
+
7
+ document.querySelector('.A').addEventListener('click',e=>{
8
+
3
- ['B','C','X','Y'].forEach(x=>document.querySelector('.A').classList.toggle(x));
9
+ ['B','C','X','Y'].forEach(x=>e.target.classList.toggle(x));
10
+
11
+ });
12
+
13
+ </script>
4
14
 
5
15
 
6
16