Answers for "how to get the value of data attribute in jquery"

0

jquery get data-id

const dataId = $('#elementId').attr("data-id");
Posted by: Guest on August-13-2020
4

jquery get data attribute

<a data-id="123">link</a>


var id = $(this).data("id"); // Will set id to 123
Posted by: Guest on April-16-2020

Code answers related to "how to get the value of data attribute in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language