Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 689 Bytes

README.textile

File metadata and controls

21 lines (14 loc) · 689 Bytes

HTML 5 Data for jQuery

This jQuery extension allows for a cleaner way to pull html data attributes out of elements with jQuery.
Data such as:

<a id = 'testId' href = '#' data-test = 'test!'>This is a test</a>

Can easier be accessed now with:

jQuery('#testId').dataAttr('test'); => 'test!'

Or set as:

jQuery('#testId').dataAttr('test', value);

Installation and usage

Just include the source after loading jQuery, thats it.

<script src="jquery.js"></script>
<script src="html5data.jquery.js"></script>

License

Copyright © 2010 Erick Schmitt, released under the MIT license.