最終更新:2018-03-07 (水) 17:13:30 (136d)  

document.querySelectorAll はてなブックマークを見る
Top / document.querySelectorAll

elementList = document.querySelectorAll(selectors);

https://developer.mozilla.org/ja/docs/Web/API/Document/querySelectorAll

メモ

  • Array.prototype.slice.call(document.querySelectorAll(selector) || []);
  • [].forEach.call(document.querySelectorAll("a"), e => console.log(e.href))

ES6

  • Array.from(document.querySelectorAll("a"),  e => console.log(e.href))

メモ