I have a project in which I have to add a registration form and I want to to validate that the password and confirm fields are equal without clicking the register button.
function check() { if(document.getElementById('password').value === document.getElementById('confirm_password').value) { document.getElementById('message').innerHTML = "match"; } else { document.getElementById('message').innerHTML = "no match"; } }
password : confirm password: