Skip to content

A simple change to jQuery to easily get html 5 "data-" attributes.

Notifications You must be signed in to change notification settings

ejschmitt/html5data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

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.

About

A simple change to jQuery to easily get html 5 "data-" attributes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published