I have been working on a project that requires me to implement a Show/Hide button on a form password field, that toggles between showing the password as plaintext, and hiding it
Please make some changes.
function text() { var a=document.getElementById('password'); var b=document.getElementById('button'); if (a.type=="password"){ a.type = "text"; b.innerText = "Hide"; } else { a.type = "password"; b.innerText = "Show"; } }
Show