title: Javascript word-count for any given DOM element
body: <p>I'm wondering if there's a way to count the words inside a div for example. Say we have a div like so:</p>
  
  <pre><code>&lt;div id="content"&gt;
  hello how are you?
  &lt;/div&gt;
  </code></pre>
  
  <p>Then have the JS function return an integer of 4.</p>
  
  <p>Is this possible? I have done this with form elements but can't seem to do it for non-form ones.</p>
  
  <p>Any ideas?</p>
  
  <p>g</p>