回答編集履歴
3
リンクがallになっていなかったので修正。
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
`document.querySelectorAll`を使えば一発です。cssのセレクタ記法と同様の書き方で、elementのリストが取得できます。
|
2
|
-
[https://developer.mozilla.org/ja/docs/Web/API/Document/
|
2
|
+
[https://developer.mozilla.org/ja/docs/Web/API/Document/querySelectorAll](https://developer.mozilla.org/ja/docs/Web/API/Document/querySelectorAll)
|
3
3
|
|
4
4
|
```javascript
|
5
5
|
var touchList = document.querySelectorAll("#application li img");
|
2
querySelectorでは1個しか取れないのでAllに変更
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
`document.
|
1
|
+
`document.querySelectorAll`を使えば一発です。cssのセレクタ記法と同様の書き方で、elementのリストが取得できます。
|
2
2
|
[https://developer.mozilla.org/ja/docs/Web/API/Document/querySelector](https://developer.mozilla.org/ja/docs/Web/API/Document/querySelector)
|
3
3
|
|
4
4
|
```javascript
|
5
|
-
var touchList = document.
|
5
|
+
var touchList = document.querySelectorAll("#application li img");
|
6
6
|
```
|
1
コードブロックに言語表記を追加。
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
`document.querySelector`を使えば一発です。cssのセレクタ記法と同様の書き方で、elementのリストが取得できます。
|
2
2
|
[https://developer.mozilla.org/ja/docs/Web/API/Document/querySelector](https://developer.mozilla.org/ja/docs/Web/API/Document/querySelector)
|
3
3
|
|
4
|
-
```
|
4
|
+
```javascript
|
5
5
|
var touchList = document.querySelector("#application li img");
|
6
6
|
```
|