我希望我的网页在密码字段内显示一个复选框。用户单击复选框并查看文本形式的密码。取消选中后,再次输入其密码。
This is what I want. This is from the Ebay website login page.
这就是我得到的
我希望这个复选框位于密码字段内。我在网上找不到有关此主题的任何内容。
这是我的代码:
<!-- Set a password for the account -->
<div class="col-md-12" style="margin: 7px;">
<input type="password" id="reg_password" name="reg_password" style="height: 35px;" class="form-control input-lg" placeholder="Password" ng-model="register_password" />
</div>
<input type="checkbox" id="eye" onclick="if(reg_password.type=='text')reg_password.type='password'; else reg_password.type='text';" />
只需添加 CSS 并将复选框移动到包含输入文本的一组 div 即可。
参见示例
#eye {
position:absolute;
right:50px;
top:6px;
}
点击这里 http://jsfiddle.net/u6pexrg1/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)