News for hackers. Stuff that matters.
Re:JQuery 1.6 released by pak on Tuesday May 03, 2011 @02:22PM (#2511056)
Question: When would you ever want the .attr("value")=="initial" in real code? How often is it that you want the original value encoded in the HTML as opposed to the current value of the element as entered by the user?

This is part of why I think .prop vs .attr is a regression. It makes me think twice before I use either--even if this is closer to how the DOM actually behaves, the point of jQuery used to be that it could hide those inane details from me.

Re:JQuery 1.6 released by timdown on Wednesday May 04, 2011 @05:19AM (#2513265)
The difference between attributes and properties is not an inane detail. It's fundamental, and if you don't understand it then you can't work reliably with the DOM, either with or without jQuery.

Bottom line: use prop().

Re:JQuery 1.6 released by donalm on Wednesday May 04, 2011 @05:42AM (#2513304)
You could use it to test if the value has been changed.