defaultValue属性包含表单元素的初始值

 1     <script type="text/javascript">
 2         $(function(){
 3             $('input[type="text"]').focus(function(){
 4               $(this).val('');
 5             }).blur(function(){
 6               $(this).val(this.defaultValue);    
 7             });
 8             /*$('input[type="text"]').focus(function(){
 9             $(this).val('');
10             });
11             $('#address').blur(function(){
12             $(this).val($addressTxt);    
13             });
14             $('#password').blur(function(){
15             $(this).val($passwordTxt);    
16             });*/
17         });
18     </script>
原文地址:https://www.cnblogs.com/vscss/p/5537616.html