Created
September 30, 2016 08:24
-
-
Save deadcoder0904/fe7d42d2a996eb9508357258bec417e7 to your computer and use it in GitHub Desktop.
Select All Elements InnerText Using Pure Javascript
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
var spans = document.querySelectorAll('element'); | |
obj = []; | |
for(var i = 0, l = spans.length; i < l; i++){ | |
obj.push(spans[i].textContent || spans[i].innerText); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment