Answers for "data-id set jquery"

0

jquery get data-id

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

jquery set data attribute value

//<div id="myElementID" data-myvalue="37"></div>
var a = $('#myElementID').data('myvalue'); //get myvalue
$('#myElementID').data('myvalue',38); //set myvalue
Posted by: Guest on October-23-2019
0

jquery get data-id

$(this).data("id") // will return the number 123
Posted by: Guest on July-18-2021
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 "Javascript"

Browse Popular Code Answers by Language