I’m trying to set a password validation in Primefaces using p:password and I need to add the show password eye icon too. I need something like the picture below, show or hide the text/password when user clicks cursor. PRIMEFACES JSF code: JAVASCRIPT code: I don’t know how to change the text to password and vice versa using javascript and p:password,