“Show password as text” control

后端 未结 7 1060
花落未央
花落未央 2021-01-05 03:21

I have a usual login form consisting of two input fields, one for login, one for password. I am currently trying to add a control that will show entered password as plain te

相关标签:
7条回答
  • 2021-01-05 03:54
    function change(){
    id.type="password";
    }
    
    
    <input type="text" value="123456" id="change">
    <button onclick="pass()">Change to pass</button>
    <button onclick="text()">Change to text</button>
    <script>function pass(){document.getElementById('change').type="password";} function text(){document.getElementById('change').type="text"; } </script>
    
    0 讨论(0)
提交回复
热议问题