Created
October 22, 2012 04:56
-
-
Save uhhuhyeah/3929709 to your computer and use it in GitHub Desktop.
grab the ids (or other attribute) from a set of DOM elements
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
// grab the ids (or other attribute) from a set of DOM elements | |
var ids = $("#mydiv span[id]") // find spans with ID attribute | |
.map(function() { return this.id; }) // convert to set of IDs | |
.get(); // convert to instance of Array (optional) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment