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