element-data-set
v1.0.0
Published
Utility for retrieving HTMLElement.dataset as a JSON object
Downloads
5
Readme
element-data-set
Utility for retrieving HTMLElement.dataset as a JSON object
Example
HTML
<div id='element' data-foo="bar"></div>
JS
var assert = require( 'assert' );
var dataSet = require( 'element-data-set' ).dataSet;
var element = document.querySelector( '#element' );
var data = dataSet( element );
assert.equal( data.foo, 'bar' );
Installation
npm install element-data-set
Contributing
We welcome your feedback and contributions. See the contribution guidelines for more details.
Additionally, you may want to consider contributing to the Capital Framework, which is the front-end pattern library used in this project.