Two Show/Hide password on the same page

Two Show/Hide password on the same page

Hi,

I use the following function to show and hide the password on an input field:


If there is only one input field on the page, it works great.

But if I have two input fields on the same page, the problem is that by clicking each of the Show/Hide buttons it changes the status in both fields. 

How can I separate this, so that each Show/Hide button works only for its own input field?

Thanks