2015-01-14 77 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>