I know I can use placeholder="some text here..." but how to make it so that the text will removed on key press instead of focus?
Is it possible using CSS or how to achieve it using jQuery?
I know I can use placeholder=some text here… but how to make it so
Share
If you would like a general solution that allows you to consider any default text value easily, consider this solution:
http://jsfiddle.net/KM43e/
All inputs of with a class name of “populated-text” will default to the text they are initialised with, and reset if you leave empty text in the field.
JavaScript:
Example inputs: