jQuery 常用代码

 

文本框,清空默认值 当焦点移到input时去掉当前值,离开还原当前值

 

 

在IE下隐藏超链接

点击button时,input 可以。 点击或获取焦点input时,在下边出现一个input type="text" 框。

<script type="text/javascript">
    $(document).ready(function(){  
        $('#mydiv').hide();
        $('#name')
           .focus(function(){  
                $('#mydiv').show();
            })
            .blur(function(){  
                $('#mydiv').show();
            });
      $('#enterInput')
            .click(function(){
			//  name.removeAttr("disabled");
                  name.attr('disabled',false);
            })  
    });
</script>
  </head>
  <body>
     <table>
     	<tr>
     		<td>
     		 <input type="text" id="name" name="name" disabled="disabled"><span><input type="button" id="enterInput"  value="手输"></span>
     		</td>
     	</tr>
	     	<tr id="mydiv">
	     		<td>
	     		 <input type="text"  >
	     		</td>
	     	</tr>
     </table>
  </body>


原文地址:https://www.cnblogs.com/java20130726/p/3218398.html