Created
January 13, 2016 15:28
-
-
Save softwarespot/c91b207a6d8e7846b37e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function closest(element, fn) { | |
return element && (fn(element) ? element : closest(element.parentNode, fn)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment