Skip to content

Instantly share code, notes, and snippets.

@awatson1978
Last active June 2, 2017 21:43
Show Gist options
  • Save awatson1978/828521fed954c5d2b23b to your computer and use it in GitHub Desktop.
Save awatson1978/828521fed954c5d2b23b to your computer and use it in GitHub Desktop.
Extract Ids From Template/Page
// the following will return an array of elements with ids set
$('[id]')
// so one would need something like this....
var elements = $('[id]');
var idsArray = [];
elements.forEach(function(element){
idsArray.push(element.id);
});
// you can also try a regex
\id="(.*?)"\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment