If you are not familiar with writing in templates, maybe let someone else do it for you.
I have put I right before the last php tags in the footer.php ( before the wp_footer() call ).
<script>
jQuery( document ).ready(function() {
// remove not functioning click fir both fields
jQuery(“#user_pass_field .password_preview”).attr(“href”, “”);
jQuery(“#user_confirm_password_field .password_preview”).attr(“href”, “”);
// attach new click
jQuery(“#user_pass_field .password_preview”).click( function(){
setPW(1)
});
jQuery(“#user_confirm_password_field .password_preview”).click( function(){
setPW(2)
});
function setPW($arg){
if($arg==1){
jQuery(‘#user_pass_field .password_preview’).toggleClass(‘dashicons-visibility’);
jQuery(‘#user_pass_field .password_preview’).toggleClass(‘dashicons-hidden’);
if(jQuery(‘#user_pass_field .password_preview’).hasClass(‘dashicons-visibility’)){
jQuery(“#user_pass”).prop(‘type’,’text’);
}else{
jQuery(“#user_pass”).prop(‘type’,’password’);
}
}else{
jQuery(‘#user_confirm_password_field .password_preview’).toggleClass(‘dashicons-visibility’);
jQuery(‘#user_confirm_password_field .password_preview’).toggleClass(‘dashicons-hidden’);
if(jQuery(‘#user_confirm_password_field .password_preview’).hasClass(‘dashicons-visibility’)){
jQuery(“#user_confirm_password”).prop(‘type’,’text’);
}else{
jQuery(“#user_confirm_password”).prop(‘type’,’password’);
}
}
}
});
</script>