I am trying to check whether the content that a user has submitted contains the correct information. I am doing this by adding the inputted context to a variable [code] and then trying an if else catch to see whether it matches what I want. [strong] variable.
However, it does not appear to be working, can anyone shed some light on this? Please see the below code.
$(document).ready(function() {
$('#button-bold').click(function() {
var code = jQuery("textarea#bold-code").val();
var $pass = "Congratulations, You have entered this correctly";
var $fail = "Oops, Look again, can you see where you have gone wrong?"
var $strong = "<strong>Recreate this preview Exactly</strong>";
if (code == strong) {
alert(pass);
$('#bold-output').append(code)
}else {
alert(fail);
}
});
});
Thank you all in advance.
$strongin one place andstrongin the other? Ditto$passand$fail.