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
JQuery solution from my code: (just change the IDs).
$(document).ready(function () { $("#eye").click(function () { if ($("#password").attr("type") === "password") { $("#password").attr("type", "text"); } else { $("#password").attr("type", "password"); } }); });