SHARE
TWEET

Untitled

a guest Aug 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Nodelist forEach polyfill
  2. if (window.NodeList && !NodeList.prototype.forEach) {
  3.     NodeList.prototype.forEach = function (callback, thisArg) {
  4.         thisArg = thisArg || window;
  5.         for (var i = 0; i < this.length; i++) {
  6.             callback.call(thisArg, this[i], i, this);
  7.         }
  8.     };
  9. }
  10.  
  11. // IEでも使える
  12. document.querySelectorAll('selector').forEach(function(element) {
  13.   element.addEventListener('click', function() { /* */});
  14. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top