Check for required exact keyword(s) in text (javascript)
<p>I need to be able to check for required keyword(s).</p>

<p>Here's what i'm currently using:</p>

<pre><code>    // Check for all the phrases
    for (var i = 0; i &lt; phrases.length; i++) {
      if (value.toLowerCase().indexOf(phrases[i].toLowerCase()) &lt; 0) {
         // Phrase not found
         missingPhrase = phrases[i];
         break;
      }
    }
</code></pre>

<p>The problem is that it'll say 'random' is fine if 'randomize' is included.</p>

<p>I found this: <a href="http://stackoverflow.com/questions/4785340/how-to-check-if-text-exists-in-javascript-var/4785521#4785521">how to check if text exists in javascript var</a> (just an example)</p>

<p>But not sure of the best way to incorporate it in jQuery with the possibly to check for multiple keywords.</p>
