ডেটা-* ব্যবহার করুন৷ এম্বেড কাস্টম ডেটা বৈশিষ্ট্য বৈশিষ্ট্য. এটি অ্যাট্রিবিউট নিয়ে গঠিত, যাতে কোনো বড় হাতের অক্ষর থাকা উচিত নয় এবং ডেটা এর পরে উপসর্গ থাকা উচিত .
উদাহরণ
<!DOCTYPE html>
<html>
<head>
<script>
function display(rank) {
var myRank = rank.getAttribute("data-rank-type");
alert("Rank " + rank.innerHTML + " has " + myRank + " points.");
}
</script>
</head>
<body>
<h1>Rank and Points</h1>
<p>Click on any rank to generate the details.:</p>
<ul>
<li onclick = "display(this)" id = "fifth" data-rank-type = "500">Fifth</li>
<li onclick = "display(this)" id = "sixth" data-rank-type = "600">Sixth</li>
</ul>
</body>
</html>