Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
 
PREVIOUS NEXT
Tagged: #jquery #set #data #attribute
ADD COMMENT
Topic
Name
2+1 =