title: javascript check if child node is element or text node
body: <p>i have problem with <code>childNodes</code> as below :</p>
  
  <pre><code> &lt;ol&gt;
      &lt;li&gt;Coffee&lt;/li&gt;
      &lt;li&gt;Tea&lt;/li&gt;
      &lt;li&gt;Coca Cola&lt;/li&gt;
   &lt;/ol&gt;
   //childNodes.length = 7
  </code></pre>
  
  <p>but</p>
  
  <pre><code>&lt;ol&gt;&lt;li&gt; Coffee &lt;/li&gt;&lt;li&gt; Tea &lt;/li&gt;&lt;li&gt; Coca Cola &lt;/li&gt;&lt;/ol&gt;
  //childNodes.length = 3
  </code></pre>
  
  <p>It seems each <code>\n</code> or <code>textnode</code> is considered a <code>child</code> ,how can i remove these from <code>childNodes</code>?</p>