how to get content from a Div that has a span which also has some content?
<p>How to get content from a Div that has a span which also has some content?</p>

<pre><code>&lt;div id="test"&gt;
 this is a DIV
 &lt;span&gt;
  This is a span
 &lt;/span&gt;
&lt;/div&gt;

alert(document.getElementById('test').innerText);
</code></pre>

<p>The code alerts me with This is a DIV This is a span.Im looking to get the content only from the DIV.</p>
