下記でh2要素の中身を抜き出して列挙できる
for (let doc of document.getElementsByTagName("h2")) { console.log(doc.innerText) }
- JavaScriptのfor文でofは値、inはプロパティをとるので注意→参考
Go to list of users who liked
More than 3 years have passed since last update.
下記でh2要素の中身を抜き出して列挙できる
for (let doc of document.getElementsByTagName("h2")) { console.log(doc.innerText) }
Register as a new user and use Qiita more conveniently
Go to list of users who liked