How To Make Show Password Button Using Javascript

by keshav


You might have seen the show password button in many login forms on different websites. In this article, we will see the code to make such a show password button using javascript. 

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:


See the Pen
show password javascript
by Vidyasheela (@_vidyasheela)
on CodePen.

If you want to download different website components and web pages you can visit here. All of them are free to use and modify.

No Comments

Post a Comment