Posted By

dyteq on 04/12/11


Tagged

form javascript TextField


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

diogoweb


Clear default textfield value on click


 / Published in: jQuery
 

URL: http://www.dyteq.com/2ndquest/?p=171

No need to create a seperate function for this one. Just one line to clear the default value on click and leave the value when it has been altered.

  1. <input name="email_address" value="Email address" onfocus="if($(this).val() == 'Email address') { $(this).val('')}" type="text">

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: ak3n on April 13, 2011

Without Jquery:

Posted By: ak3n on April 13, 2011

lol, funny bug, code:

Posted By: ak3n on April 13, 2011

Argh, amazing web-site. Code: http://pastebin.com/LkVYnNQS

You need to login to post a comment.