Return to Snippet

Revision: 46851
at May 26, 2011 19:49 by smonteru


Initial Code
<script type="text/javascript">
            $(document).ready(function(){
                $("input[type=text]").focus(function(){
                    if(this.value == this.defaultValue){
                        $(this).val("");
                    }
                });
            }); 
        </script>

Initial URL

                                

Initial Description
Reset input type text onfocus if value differs from default.

Initial Title
Form input type text reset onfocus

Initial Tags
form, javascript, jquery

Initial Language
JavaScript