<!DOCTYPE html>
<html>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<input type="password" id="txtNewPassword" placeholder="Enter passward" name="pass">
<input type="password" id="txtConfirmPassword" placeholder="Confirm Passward" name="confpass" >
<div class="registrationFormAlert" style="color:green;" id="CheckPasswordMatch">
<script>
function checkPasswordMatch() {
var password = $("#txtNewPassword").val();
var confirmPassword = $("#txtConfirmPassword").val();
if (password != confirmPassword)
$("#CheckPasswordMatch").html("Passwords does not match!");
else
$("#CheckPasswordMatch").html("Passwords match.");
}
$(document).ready(function () {
$("#txtConfirmPassword").keyup(checkPasswordMatch);
});
</script>
<body>
</html>