Last active
December 18, 2015 09:19
-
-
Save gbradley/5760102 to your computer and use it in GitHub Desktop.
Probably the quickest way you're gonna be able to do this...
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
| var divs = document.querySelectorAll ? document.querySelectorAll('div[id^=csc]') : (function(){ | |
| var divs = (document.getElementById('commonAncestorElementIdGoesHere') || document).getElementsByTagName('div'), | |
| i = divs.length, | |
| result = [], | |
| div; | |
| while (i--){ | |
| div = divs[i]; | |
| if (div.id && div.id.match(/^csc/)){ | |
| result.push(div); | |
| } | |
| } | |
| return result; | |
| })(); | |
| console.log(divs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment