Want to find out about change password displayed in clear text

I am working on AccountsTemplate using changePwd template which is auto generated i want password to be displayed in clear text.

The general strategy is to swap the type of the input field from password to text when the user clicks the button to reveal.