2015-01-14 81 views
0

有没有办法来禁用屏蔽?禁用屏蔽输入类型密码

我试图input[type='password'][name='TxtPassword]{ -webkit-text-security: none !important;}

但这并没有工作。

在此先感谢。

+0

安全......没有重要的... ...听起来很危险的。 – Raptor

+0

如何输入'type = text' –

回答

0

您可以使用JavaScript更改类型。设置类型为text将显示文本。

document.querySelector("button").addEventListener("click", function() { 
 
    var textbox = document.querySelector("input"); 
 
    if (textbox.type == "password") { 
 
     textbox.type = "text"; 
 
    } else { 
 
     textbox.type = "password"; 
 
    } 
 
});
<input type="password" value="password" /> 
 
<button>Toggle type</button>