Clear default textfield value on click

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

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.

Copy this code and paste it in your HTML
  1. <input name="email_address" value="Email address" onfocus="if($(this).val() == 'Email address') { $(this).val('')}" type="text">


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.