The logic behind this show password button is straightforward. What we do is just change the "type" attribute's value of the input to "text" from "password" when we want to make the password visible and reset it to "password" when we want to hide.
Following is the code to do so. The code is simple and self-explanatory. We have used visibility icons from google icons. You can use whatever you like to use.
If you want to see the video:
If you want to download different website components and web pages you can visit here. All of them are free to use and modify.