From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Implementing show/hide password functionality

Implementing show/hide password functionality

Now, the sign up form is almost complete. In this lecture, we will implement the show hide feature of the password input box. So let's begin. Now for the show hide feature, we have already placed the icons. So let's go to the code and give id password inp that is input to the password input and confirm password input to the confirm password input box. Now I will define the script tag and take the reference of both input boxes in variables. I will say let password input is equal to document.getElementById password input and let confirmPasswordInput be document.getElementById confirmPasswordInput. Alright so now we have the reference of inputs. To show the text we just have to change the type to text and to hide we change it to password. So to toggle that attribute, we will create a common function. So const toggleDisplay is equal to the event argument. Now to decide the input box and the value to be set, we will manipulate the name attribute of the icon. Later on, I will explain why I…

Contents