Skip to content
Recommend our themes and earn 30% of our share of every sale you bring. Free to join.Earn by recommending our themes Become an affiliate

How to access HTML5 data attributes with jQuery

Updated 13 Sep 2018

Source code

<div data-attr-name="Attr Value">Div</div>
<script>
$(document).ready(function() {
	$("div").data("attr-name");
});
</script>

More code answers

Comments

Log in to leave a comment.