Html
<div id="you" data-you="Hello mean">super</div>
is #you html element change data-you attribute
console.log($("#you").data("you")); // Hello mean
$("#you").attr("data-you", "yes change you atribute");
console.log($("#you").data("you")); // Hello mean | does not change.
Attribute “data-you” does not change when I change. How can I do this?
thank you.
attr() And you can not have to change the data() method.
Try the following way:
examples of data
http://api.jquery.com/data/