回答編集履歴

2

.

2022/07/15 07:00

投稿

int32_t
int32_t

スコア20923

test CHANGED
@@ -6,3 +6,6 @@
6
6
  }
7
7
  ```
8
8
 
9
+ `buttonClose` と `modalScale` に関しては、対象はクリックした要素の先祖の `.modal` でしょうから、`event.target.closest('.modal')` を対象にしましょう。
10
+
11
+

1

.

2022/07/15 04:35

投稿

int32_t
int32_t

スコア20923

test CHANGED
@@ -2,7 +2,7 @@
2
2
  ```js
3
3
  x.addEventListener('click', modalOpen);
4
4
  function modalOpen(event) {
5
- event.target.nextElementSibling.querySelector('.modal').stye.display = "block";
5
+ event.currentTarget.nextElementSibling.querySelector('.modal').stye.display = "block";
6
6
  }
7
7
  ```
8
8