Quantcast
Channel: From the Code Mill
Viewing all articles
Browse latest Browse all 10

Get HTML5 Data Attributes with jQuery

$
0
0
jQuery 1.4.4+ includes this already, using DOMElement.getAttribute(), but for prior versions you can bind an element to the getData event.  This event is fired internally by jQuery.fn.data if you attempt to retrieve data for a key that has no corresponding value in the data cache.  The event handler can then be used to query the […]

Viewing all articles
Browse latest Browse all 10

Trending Articles