Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. NodeList.prototype.forEach = Array.prototype.forEach;
  2. var byhref = {};
  3. document.querySelectorAll("a[href]").forEach(function(e){
  4. byhref[e.href] = "undefined" === typeof byhref[e.href] ? [e] : [].concat(byhref[e.href],e); //collect links (different objects, same url)
  5. });
  6.  
  7. byhref
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement