i want to change the color of html text if the password is error then it should be shown in red color and if is correct then it should be shown in green color here is the code i am not using jquery i have searched it through the stack flow i found n i tried to implement it but it doesn't worked so i posted this question
<div class="td">
<input type="password" id="txtNewPassword" />
</div>
<div class="td">
<input type="password" id="txtConfirmPassword" onChange="checkPasswordMatch();" />
</div>
<div class="registrationFormAlert" id="divCheckPasswordMatch">
</div>
and the javascript
function checkPasswordMatch() {
var password = $("#txtNewPassword").val();
var confirmPassword = $("#txtConfirmPassword").val();
if (password != confirmPassword)
$("#divCheckPasswordMatch").html("Passwords do not match!");
else
$("#divCheckPasswordMatch").html("Passwords match.");
}
$(document).ready(function () {
$("#txtNewPassword, #txtConfirmPassword").keyup(checkPasswordMatch);
});
i want to change the color of Passwords do not match! to red and passwords match to green