function togglePassword(){ var passwordField = document.getElementById("togglePasswordBtn"); if(passwordField.type === 'password'){ passwordField.type = 'text'; } else if(passwordField.type === 'text'){ passwordField.type = 'password'; } } document.getElementById('togglePasswordBtn2').addEventListener('click', function() { var passwordField2 = document.getElementById("togglePasswordBtn"); if(passwordField2.type === 'password'){ passwordField2.type = 'text'; } else if(passwordField2.type === 'text'){ passwordField2.type = 'password'; } });