发布于 2016-09-22 10:58:22 | 164 次阅读 | 评论: 0 | 来源: 网友投递
jQuery javascript框架
jQuery是一个兼容多浏览器的javascript框架,核心理念是write less,do more(写得更少,做得更多)。jQuery在2006年1月由美国人John Resig在纽约的barcamp发布,吸引了来自世界各地的众多JavaScript高手加入,由Dave Methvin率领团队进行开发。
<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>