title: Search certain words in a string from a big list of array Jquery
body: <p>How do I search through each word in a string of a <p> that matches an array?</p>
  
  <p>Here is my prototype:</p>
  
  <pre><code>        $("#latte").on("click", function() {
  
              $('#lattePool').load('dictionary.txt'); 
  
              var text = $("#lattePool").text().toUpperCase();
              var words = text.split("\n");
              var dictionary = new Array();
              for(var i=0; i &lt; words.length; i++) {
                  dictionary[i] = words[i];
              };
  
              $("#notes p").each(function(){
                  var nameFound = $.inArray($(this).text().trim().toUpperCase(), dictionary);
                  if (nameFound === -1){
                  } else {
                      alert($(this).text() + " found in array");
                 }
              });
  
          });
  </code></pre>
  
  <p>When user click on #latte button, it loads a dictionary.txt text into a temporary pool call #lattePool, then it breaks down into individual words and then into a very long array.</p>
  
  <p>Then, wehn user paste something in a contenteditable div #notes, it needs to find each words in the <p> tag with all the words in the dictionary array.</p>
  
  <p>currently it only works with a single word in a <p>, not a long string.</p>
  
  <p>Any ideas to make it check through each word of a <p> from an array?</p>
  
  <p>Many thanks~!!!</p>