Created
July 1, 2015 09:32
-
-
Save arunkumr/46902270dab020be8907 to your computer and use it in GitHub Desktop.
Used to get all elements based on availability of attribute name.
This file contains 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 getAllElementsWithAttribute(d,parent) { | |
for (var c = [], b = parent.getElementsByTagName("*"), a = 0, e = b.length;a < e;a++) { | |
null !== b[a].getAttribute(d) && c.push(b[a]); | |
} | |
return c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment