Following case: the page is rendered with the following …
<input class="textInput error" id="accountMailaddress" name="user[email]" size="30" type="text" value="some@mailaddress.com">
So I see an input with “some@mailaddress.com” already filled out.
If the user changes the text inside of it the value attribute of the input doesn’t change in my dom-inspector. So I assume it’s possible to test the text that the user just typed against the original value (in the value attribute).
How can I do so?
Thank you in advance.
more info …
e.g. I’m logging $('.textInput').val(); on every keypress, val(); always holds the current text the user enters. Do I just have to store the original value in a variable?
also, defaultValue is cross browser compatible