Answers for "how to add value to data attribute jquery"

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

Code answers related to "how to add value to data attribute jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language