Return to Snippet

Revision: 61110
at November 28, 2012 21:43 by rickygri


Initial Code
$.fn.search=function(){return this.focus(function(){if(this.value==this.defaultValue){this.value=""}}).blur(function(){if(!this.value.length){this.value=this.defaultValue}})}
$("input, textarea").search();

Initial URL

                                

Initial Description
Clear text input when the user selects it (on focus)

Initial Title
Clear form input on focus

Initial Tags
forms, jquery

Initial Language
JavaScript