title: How to extract text directly under an HTML tag using Javascript
body: <p>I need to extract the text that is directly under an HTML tag. For example, if my HTML looks like:</p>
  
  <pre><code>&lt;span&gt;This is Outside Text
        &lt;span&gt;This is Inside Text&lt;/span&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>then I need a way to extract ONLY "This is Outside Text" and NOT "This is Inside Text". <strong>I have tried "innerHTML", innerText", "textContent" and also tried to use RegEx</strong> (although I am not very good at it). But I am unable to find a solution. Any help would be much appreciated.</p>
  
  <p>Please note that due to some technical constraints, I need to use <strong>"plain" Javascript ONLY</strong> and <strong>NOT jQuery</strong> (which I know is nothing but Javascript, but I am forbidden from using it for this solution)</p>