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
Show function text(item){ if(item.innerText=='Show'){ item.innerText='Hide'; document.getElementById('password').type="password"; }else{ item.innerText='Show'; document.getElementById('password').type="text"; } }