Created
May 14, 2015 07:30
-
-
Save kn9ts/725b2603ab659791adc3 to your computer and use it in GitHub Desktop.
Looping through child nodes/element siblings inclusive of textual content looking for text
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
Array.prototype.filter.call(e.querySelector("div").childNodes, function(e) { | |
return 3 == e.nodeType && -1 != e.nodeValue.indexOf(":") | |
}).forEach(function(e) { | |
e = e.nodeValue.split(":", 2); | |
t[e[0].trim().toLowerCase()] = e[1].trim() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment