Skip to content

Instantly share code, notes, and snippets.

@sidepodcast
Created August 20, 2010 18:30
Show Gist options
  • Save sidepodcast/540866 to your computer and use it in GitHub Desktop.
Save sidepodcast/540866 to your computer and use it in GitHub Desktop.
Find custom data attribute information using jQuery
// nb: assumes use of jquery
//
// array
var existing = [];
// grab list items
$("li[data-identifier]").each(function() {
// add to array
existing.push($(this).attr("data-identifier"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment