this is my first time trying to incorporate an array into my javascript code. I am using this with a form that contains a text input in which only the colors Blue, Yellow, Gray, Orange or Pink can be submitted, otherwise there should be an alert. Clearly I have made some error as my values are not being picked up...anything can be entered into the input #color and the form can still be submitted, no alert ever populates regardless of what I enter. Code is below. Thank you.
}
// Verifies Colors
var colors = ["Blue", "Yellow", "Gray", "Orange", "Pink"];
if ($('#color').val() != colors) {
alert("These are not the right colors!");
return false;
}
return true;
}