发布于 2016-09-22 10:58:22 | 164 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的jQuery示例,程序狗速度看过来!

jQuery javascript框架

jQuery是一个兼容多浏览器的javascript框架,核心理念是write less,do more(写得更少,做得更多)。jQuery在2006年1月由美国人John Resig在纽约的barcamp发布,吸引了来自世界各地的众多JavaScript高手加入,由Dave Methvin率领团队进行开发。


密码框的显示隐藏有多种实现方法,在将为大家介绍下如何使用jquery实现,感兴趣的朋友可以参考下

 
<html> 
<head> 
<script type="text/javascript" src="jquery-1.5.1.min.js"></script> 
<script type="text/javascript"> 
$(function(){ 
$("#chk").bind({ 
click: function(){ 
if($(this).attr("checked")){ 
$("#passwd2").val($("#passwd").val()); 
$("#passwd").hide(); 
$("#passwd2").show(); 
}else{ 
$("#passwd").val($("#passwd2").val()); 
$("#passwd2").hide(); 
$("#passwd").show(); 
} 
} 
}); 
}); 
</script> 
</head> 
<body> 
<form name="formName"> 
<input id="passwd" type="password" 
size="24" maxlength="17" 
style="ime-mode: disabled; display: inline;"/> 
<input id="passwd2" type="text" 
size="24" maxlength="17" 
style="ime-mode: disabled; display: none;" /> 
<input id="chk" type="checkbox" />显示密码 
</form> 
</body> 
</html> 



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务