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>

Reviews and Comments