SanSYS

Untitled

Jun 13th, 2015
5,152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function closest(el, fn) {
  2.     while (el) {
  3.         if (fn(el)) return el;
  4.         el = el.parentNode;
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment