Skip to content

Instantly share code, notes, and snippets.

@fchasen
Last active December 20, 2015 13:48
Show Gist options
  • Save fchasen/6141049 to your computer and use it in GitHub Desktop.
Save fchasen/6141049 to your computer and use it in GitHub Desktop.
Get all nodes with Ids
//-- Get all nodes with Ids
this.$ = {};
Array.prototype.map.call(document.querySelectorAll('[id]'),
function(node){ this.$[node.id] = node; }.bind(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment