Show/Hide Password
Toggle password field visibility with a button, switching between type="password" and type="text".
Toggle password field visibility with a button, switching between type="password" and type="text".
$("#togglePass").on("click", function() {
const input = $("#password");
const isText = input.attr("type") === "text";
input.attr("type", isText ? "password" : "text");
$(this).html(isText ? "Show" : "Hide");
});
Use an eye icon instead of text for a cleaner UI — toggle between bi-eye and bi-eye-slash.