Created
May 7, 2014 10:36
-
-
Save abrjagad/e40d10688c9503b8f54b 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 upTo(element, myclassName) { | |
do { | |
element = element.parentNode; | |
if (element.className.indexOf(myclassName) > -1) { | |
return element; | |
} | |
} while (element); | |
return null; | |
} | |
upTo(this, "level-dt"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment