Form default values


/ Published in: jQuery



Copy this code and paste it in your HTML
  1. jQuery(document).ready(function(){
  2. $("input, textarea").focus(function(){
  3. if ($(this).attr("value") == $(this).attr("title"))
  4. $(this).attr("value", "")
  5. });
  6.  
  7. $("input, textarea").blur(function(){
  8. if ($(this).attr("value") == "")
  9. $(this).attr("value", $(this).attr("title"))
  10. });
  11. });

URL: http://habrahabr.ru/blogs/jquery/98010/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.