show password on click button jquery code example
Example 1: show password on click button jquery
$('.view-password').on('click', function () {
let input = $(this).parent().find(".pass");
input.attr('type', input.attr('type') === 'password' ? 'text' : 'password');
});
Example 2: jquery show password
$("#showpaswd").click(function () {
var x = document.getElementById("cpassword");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
});