jQuery HTML5 dataAttr Pseudo Selector

added by elijahmanor
5/9/2012 8:43:51 AM

3 Kicks, 269 Views

A while back someone on twitter was asking me how they might find a set of DOM elements by using doing a partial search on their HTML5 data attribute...


1 comments

dpeterson
5/9/2012 8:43:55 AM
Hmm, this is an interesting idea. It allows for using jQuery to do things like searches on DOM elements without having to parse the contents of each element (if you were to add meaningful data attributes). I wonder how this method of searching would fair against searching a JSON object for what you're looking for, then re-rendering the results rather than hiding the elements that don't match.