I have this html
<input type="text" value="" id="AA">
In Firefox 8.0.1, if I enter CCC inside the inputbox, inspect with Firebug still showing
<input type="text" value="" id="AA">
instead of
<input type="text" value="CCC" id="AA">
So when I
alert($('input[value=""]').size())
it produce 1 which should be 0. But when I
alert($('input[value=""]').val())
it produce CCC. So how to update the attribute “value” to reflect the actual value?
Another way of doing it would be:
http://jsfiddle.net/cU7E4/1/
UPDATE:
As pointed out by Shaheer, it can be done with a single line of code.