I need to be able to check for required keyword(s).
Here's what i'm currently using:
// Check for all the phrases
for (var i = 0; i < phrases.length; i++) {
if (value.toLowerCase().indexOf(phrases[i].toLowerCase()) < 0) {
// Phrase not found
missingPhrase = phrases[i];
break;
}
}
The problem is that it'll say 'random' is fine if 'randomize' is included.
I found this: how to check if text exists in javascript var (just an example)
But not sure of the best way to incorporate it in jQuery with the possibly to check for multiple keywords.