回答編集履歴
1
コメントを受けて追記
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
要は、jQueryの使い方を知りたい、ということでいいでしょうか?
|
2
2
|
|
3
|
-
`fetch('https://teratail.com').then(res => res.text()).then(txt => console.log($("div
|
3
|
+
`fetch('https://teratail.com').then(res => res.text()).then(txt => console.log($("div.classname > a", txt)));`
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -13,3 +13,17 @@
|
|
13
13
|
|
14
14
|
|
15
15
|
言うまでもなく、実行するページにjQueryが読み込まれている前提です。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
### コメントを受けて追記
|
20
|
+
|
21
|
+
`fetch('https://teratail.com').then(res => res.text()).then(txt => console.log($("div.classname > a", txt)[0]));`
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
参考:
|
26
|
+
|
27
|
+
> The jQuery object itself behaves much like an array; it has a length property and the elements in the object can be accessed by their numeric indices [0] to [length-1].
|
28
|
+
|
29
|
+
[Types | jQuery API Documentation](http://api.jquery.com/Types/#jQuery)
|