Hello readers, Today in this blog you’ll learn how to create show/hide password toogle in Javascript. Earlier, you have learned to create contact us page using HTML & CSS with cool animations. I have also created a blog on other cool stuffs of web designing.

 

Password toogle is used to either show or hide the password entered by user in the input field. If user wants to see the password s/he entered, then they click the toogle button and they can easily see their password. So, for ease of the user we have to create the toogle button. So today I am going to show you how you can create password toogle button in Javascript.

 

At first, I have created a container div with full width and height of 100 viewport height(vh) and inside that container I have created form and inside form there is a input field of the type ‘password’. As a toogle button I have used a eye icon from the font awesome. In that <i> tag, i have included onclick event to show the password if user click it. Now you have to change the input type form password to text and vice versa using javascript if user click the icon.

 

If you’re feeling difficult to understand what I am saying. You can watch a full video tutorial on this program (Password show/hide toogle in Javascript).

 

You Might Also Like

Video Tutorial of Show/Hide Password Toogle in Javascript 


All this page design is based on CSS and the password toogle is based on Javascript. If you’re a beginner you can also create this type of password show/hide toogle. If you like this program (Password show/hide toogle in Javascript) and want to get source code. You can easily get the source code of this program. To get the source codes you just need to scroll down.

Password show/hide toogle in Javascript [Source Codes]

To create this program (Password show/hide toogle in Javascript). First, you need to create three files one HTML file, one CSS file and one Javascript file. After creating these files just paste the following code in your file. First, create an HTML file with the name of index.html and paste the given codes in your HTML file. Note it, you’ve to create a file with .html extension.

HTML

Second, create a CSS file with the name of style.css and paste the given code in your CSS file. Note it, you’ve to create a file with .css extension.

CSS

At last, create a Javascript file with the name of script.js and paste the given code in your Javascript file. Note it, you’ve to create a file with .js extension.

Javascript

 

 Note: you can use this Javascript code internally in your HTML file just before the </body> tag. 

That’s all, now you’ve successfully created a password show/hide toogle in Javascript. If your code does not work or you’ve faced any errors/problems then please comment down. If you feel this article had helped you, please share it with your friends.

Post a Comment

أحدث أقدم