I need the function below to return images, it is for a password check and the image should appear as a cross or a tick when its correct or wrong. this is the code so far
<script type="text/javascript">
function checkPasswordMatch() {
var password = $("#txtNewPassword").val();
var confirmPassword = $("#txtConfirmPassword").val();
if (password != confirmPassword)
$("#divCheckPasswordMatch").html("Passwords do not match!" & <img src="img/cross.png" alt="some_text">);
else
$("#divCheckPasswordMatch").html("Passwords match." & <img src="img/tick.png" alt="some_text">);
}
I have tried doing it a couple of ways above si the main way i tried than i also tried to comment the whole image statement but nothing seems to work I'm usually getting syntax errors. i am new to programming as well if this explains why i haven't already figured it out.
$("#divCheckPasswordMatch").html('Passwords do not match! <img src="img/cross.png" alt="some_text">');