Response title
This is preview!
I add the value through jQuery
All works well.
Now I want to replicate the functionality of a 'placeholder' HTML5 attribute and do so by the following:
- On key-down check if the input's value is equal to 'enter' and if so then remove the value using the 'attr' method, e.g.
- On key-up check if the input field has no value and if so then add the value using the 'attr' method, e.g
Issue
FireFox 3.5.19 does not render the new values of the 'attr' method. Firefox 3.5.19 will change the DOM accordingly, but will not render the new value in the input field.
Solution
Don't use the 'attr' method, use the 'val' method.
Hope this helps anyone who is struggling with the same issue.
© 2013 jQuery Foundation
Sponsored by and others.