const togglePassword = document.querySelector("#togglebfb-control-n2hybhx");
const password = document.querySelector("#bfb-control-kv9r4a9");
const confirmpassword = document.querySelector("#bfb-control-bo3m052");
togglePassword.addEventListener("click", function () {
// toggle the type attribute
const type = password.getAttribute("type") === "password" ? "text" : "password";
password.setAttribute("type", type);
// toggle the icon
this.classList.toggle("bfb-control-n2hybhx bfb-control mgz__actions-switch-checkbox");
});
togglePassword.addEventListener("click", function () {
// toggle the type attribute
const type = confirmpassword.getAttribute("type") === "password" ? "text" : "password";
confirmpassword.setAttribute("type", type);
// toggle the icon
this.classList.toggle("bfb-control-n2hybhx bfb-control mgz__actions-switch-checkbox");
});
confirmpassword.addEventListener("input", function () {
if ($('#bfb-control-bo3m052').val() == $('#bfb-control-kv9r4a9').val()) {
$('#message').html('Password matches').css('color', 'green');
} else
$('#message').html('Please make sure your passwords match.').css('color', 'red');
});
password.addEventListener("input", function () {
if ($('#bfb-control-kv9r4a9').val() == $('#bfb-control-bo3m052').val()) {
$('#message').html('Password matches').css('color', 'green');
} else
$('#message').html('Please make sure your passwords match').css('color', 'red');
});