<input style="width: 92%; display: inline-block;" type="password" id="dbpwd" name="dbpwd" lay-verify="required"
lay-reqtext="用户名是必填项,岂能为空?" placeholder="请输入"
autocomplete="off" class="layui-input" >
<button type="button" class="fa fa1 btn1 fa-eye" id="passwordeye" data-type="switchPwd" style="line-height: 24px;" aria-hidden="true"></button>
switchPwd: function(){
var passwordeye = $('#passwordeye');
var showPwd = $("#dbpwd");
if(passwordeye.hasClass('fa-eye-slash')){
passwordeye.removeClass('fa-eye-slash').addClass('fa-eye');//密码可见
showPwd.attr('type','password');
form.render();
}else{
passwordeye.removeClass('fa-eye').addClass('fa-eye-slash');//密码不可见
showPwd.attr('type','text');
form.render();
};
},