How do I add a second password field?

So I’ve managed to make a code work for confirm password. but the second password field is a regular text field. How do I make it so that the password is hidden and displays as dots for the second password field too?