Possible duplicate:
jQuery.attr returns user attributes undefined
I have a strange problem, but I hope that I'm just doing something stupid. I am trying to create a new attribute of an <img> element using jQuery, and this line:
$(selector).attr('selected', 'no');
When I check the DOM in Chrome, I just see selected = "selected", regardless of what I set the value to.
Just additional information: I canβt use only logical values, since I need to track the values ββof the Yes, No, and Partial properties. I call the JS function from the onClick event of img itself and pass this as a parameter. I checked the object in the method and passed the correct object; the fact that the attribute is set (even if the error value) also supports this.
I'm sure I am doing something stupid here ... Any advice would be appreciated.
source share