The brillant folks at gov.uk explain the difficulties while creating an option to securely and accessibly show the password in a password field to their users. Here you can see a working example in their component guide.
Creating an accessible show Password Option
Posted