I tried this and my console just gave me two empty lines for the console.log(password.value)
and console.log(confirm_pass.value)
Also I get an error about ‘incorrect use of <label for=form_Element>
‘ issue in the html inspect section
var password = document.getElementById("pass");
console.log(password.value);
conifrm_pass = document.getElementById("pass_conf");
console.log(password.value);
console.log(conifrm_pass.value);
if (password.value != conifrm_pass.value) {
alert("The password and confirm password don't match");
}
New contributor
nikhil chobhiyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1