docyes / datadash

HTML5 custom data attributes sans-camel-case

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retrieve HTML5 custom data-* attributes (or any others) key/value pairs sans-camel-case.

data-* usage:
<a href="http://trailerparks.com" data-trailer="airstream" data-park="double dutch RV park">Live the dream!</a>
<script>
	var data = datadash(document.getElementsByTagName()[0]);
	assertEquals(data['data-trailer'], 'airstream');
	assertEquals(data['data-park'], 'double dutch RV park');
</script>

About

HTML5 custom data attributes sans-camel-case