How to access HTML5 data attributes with jQuery
Source Code:
<div data-attr-name="Attr Value">Div</div>
<script>
$(document).ready(function() {
$("div").data("attr-name");
});
</script>
<div data-attr-name="Attr Value">Div</div>
<script>
$(document).ready(function() {
$("div").data("attr-name");
});
</script>