I have this line in jQuery and I want to set row=(that) in my code value to changed. When edited on that.
<tr data-state="unChanged">
$(that).data('state').value = "changed";
I get assignment left side error.
try this:
$(that).attr('data-state', 'changed'); // jQuery
var tdEelem = document.getElementById('someId'); // Javascript
tdEelem.setAttribute('data-stat' , 'changed');
.data() method can only be used to modify the jQuery object — it does not write into the DOM (i.e. modify HTML5 data- attributes).