1

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.

2 Answers 2

1

try this:

$(that).attr('data-state', 'changed'); // jQuery

var tdEelem = document.getElementById('someId');  // Javascript
tdEelem.setAttribute('data-stat' , 'changed');  
Sign up to request clarification or add additional context in comments.

2 Comments

Also good to note that jQuery's .data() method can only be used to modify the jQuery object — it does not write into the DOM (i.e. modify HTML5 data- attributes).
I have try with Jquery . It doesn't change attribute . I can read this value . I am on right that . have checked . I cannot change.
0
 $(that).data("state","changed");

I have fixed with this line...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.