手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jquery 实现密码框的显示与隐藏示例代码
jquery 实现密码框的显示与隐藏示例代码
摘要:复制代码代码如下:$(function(){$("#chk").bind({click:function(){if($(this).attr...

复制代码 代码如下:

<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>

【jquery 实现密码框的显示与隐藏示例代码】相关文章:

jquery实现图片左右切换的方法

js实现顶部可折叠的菜单工具栏效果实例

一段实时更新的时间代码

jquery实现弹出层效果实例

javascript实现动态改变层大小的方法

jquery读取xml文件实现省市县三级联动的方法

jQuery实现文本展开收缩特效

基于jQuery实现的无刷新表格分页实例

JQuery实现动态添加删除评论的方法

些很实用且必用的小脚本代码

精品推荐
分类导航