title: How to extract text from div in javascript without extracting from children divs?
body: <p>Let's say I have the following html:</p>
  
  <pre><code>&lt;div class="targetDiv"&gt;
      Target text
      &lt;div class="junkDiv"&gt;
            Text I don't want
      &lt;/div
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I know I can find divs like these and extract all of the text recursively  by doing <code>document.getElementsByClassName("thread")[x].innerText</code> (where x is the index of the div I want to extract from). This will give me "Target textText I don't want". </p>
  
  <p>My question is how do I extract "Target text" without extracting "text I don't want"?</p>