I achieved this by doing the following, but as a newbie to javascript and jquery, I want to know if there is a shorter way to add a few possible values.
if ($("input:first").val().toUpperCase() == "UNITED STATES" || $("input:first").val().toUpperCase() == "USA" || $("input:first").val().toUpperCase() == "AMERICA") {
$("#check").text("Correct!").show().fadeOut(5000);
return true;
how
if ($("input:first").val().toUpperCase() == ("UNITED STATES","USA","AMERICA")) {
$("#check").text("Correct!").show().fadeOut(5000);
return true;
this confirms only the latest answers in this case AMERICA.
source
share