Jquery Update Data- Attribute/value
I have a DIV that looks like this...utilizing the 'data-gauge' attribute.
Solution 2:
You could use either
$("#uib-justgage-3").data('gauge')
or $("#uib-justgage-3").attr('data-gauge')
for reading the attribute
and
$("#uib-justgage-3").data('gauge','new value')
or $("#uib-justgage-3").attr('data-gauge','new value')
for setting the attribute
Solution 3:
$('#uib-justgage').data({'rpath','Hello'});//sets data-rpath = Hello
$('#uib-justgage').data('rpath');//gets the value assigned to 'data-rpath'
Post a Comment for "Jquery Update Data- Attribute/value"