on focus remove input value


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2. $('.rmv-dft-val').click(
  3. function() {
  4. if (this.value == this.defaultValue) {
  5. this.value = '';
  6. }
  7. }
  8. );
  9. $('.rmv-dft-val').blur(
  10. function() {
  11. if (this.value == '') {
  12. this.value = this.defaultValue;
  13. }
  14. }
  15. );
  16. });

URL: http://buildinternet.com/2009/01/changing-form-input-styles-on-focus-with-jquery/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.