title: Count specific words in a text using jQuery
body: <p>How do I do this in jQuery?</p>
  
  <p>For example I have a variable called paragraph</p>
  
  <pre><code>var paragraph = 'AAA BBB AAA CCC AAA AAA DDD EEE AAA';
  </code></pre>
  
  <p>I want to count all 'AAA' in the paragraph</p>
  
  <p>I try to use <code>.val().match('AAA').length</code> it always gives me 1</p>