title: Word Counter Java Script on Google Chrome Extension
body: <p>I'm coding a Google Chrome extension, and the goal is to count words. Currently, I have a system so that every 5 characters = 1 word. However, it's still counting <code>&lt;script&gt;</code> and <code>&lt;style&gt;</code> tags. It would ideally also not count <code>&lt;a&gt;</code> tags.I've implemented every suggestion I've received in the past. This is my code in the JavaScript:</p>
  <pre><code>var length = $(&quot;body&quot;).not(&quot;script&quot;, &quot;style&quot;, &quot;a&quot;).contents().filter(function() {
                      return (this.localName != &quot;script&quot; &amp;&amp; this.localName != &quot;style&quot;) ? true : false;
                    }).text().replace(/ +/g, &quot;&quot;).length;
  </code></pre>