DEV Community

Kaviya R
Kaviya R

Posted on

First project in Java SCRIPT

Today i created a input box with eye symbol that is like when we press the eye symbol the text will be visible and without that action the text will not visible .It just seems like a dots.In that process i learnt so many new things in front-end.

if(open=='on'){
            document.getElementById("our-eye").style.display="block"; 
            name.style.display="none";  
            document.getElementById("text").type="text";
        }
           else {
            name.style.display="block";
            document.getElementById("our-eye").style.display="none";
            document.getElementById("text").type="password";
           } 
Enter fullscreen mode Exit fullscreen mode

This is js part where I write code for both eye symbol and the change in text style.Instead of calling the same Id for many times in the function we can store that element in the const variable.After completing this project i feel so happy and I'm excited for my upcoming projects.

Top comments (0)