联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

jquery 实现密码框的显示与隐藏示例代码 - Web前端

作者:98wpeu发布时间:2026-08-07分类:网页前端技术浏览:1


导读:复制代码代码如下:<html><head><scripttype="text/javascript"src="JQuery-1.5.1.min...

复制代码 代码如下:
<html>
<head>
<scripttype="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>

标签:示例密码代码Webjquery


网页前端技术排行
最近发表
网站分类
标签列表