I want to create password toggle function when clicked on the eye icon using Javascript only. I have written code for it but it works only to show the password text and not
We can get by using onclick event, let's see example.It is very easy
HTML
Javascript
function showHide() { if (pwd.type == 'text') { pwd.type = 'password'; } else { pwd.type = 'text'; } }