toggle password eye code example
Example 1: how to make a show password button
function myFunction() {
var x = document.getElementById("*passwordbox-id*");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
Example 2: show password fa-eye javascript
$("body").on('click', '.toggle-password', function() {
$(this).toggleClass("fa-eye fa-eye-slash");
var input = $("#pass_log_id");
if (input.attr("type") === "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});