Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a = {
  2.   "div .a": [function (e) { e.preventDefault(); }, function () {}],
  3.   "a": [function (e) {}]
  4. };
  5.  
  6. for (var i in a) {
  7.     Array.prototype.slice.call(document.querySelectorAll(i)).forEach(x => x.addEventListener(a[i]));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement