title: How to get text nodes and tagged nodes out of contents of a Div element in javascript?
body: <p>I have included some textual content in a div element. I want to access individual nodes out of it in the form of strings.
  Some nodes are tagged in bold, and therefore the rest of nodes that are formed in the text are non-tagged. I am trying to access all the individual nodes thus formed using nodeList, or through a simple indexed loop using childNode property. I have even used document.queryselectorAll(), but nothing seems to work.Following is the code snippet:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;body&gt;
    &lt;div id=&quot;mydiv&quot; class=&quot;myDiv&quot; contenteditable=&quot;true&quot;&gt;This &lt;b&gt;life&lt;/b&gt; is my choice, &lt;b&gt;anyway&lt;/b&gt; I know how to lead a good one!!!&lt;/div&gt;
  &lt;/body&gt;
  &lt;script&gt;
   let myString ='';
              for(let i=0; i&lt;mydiv.childNodes.length;i++){
           myString = mydiv.childNodes[i]+mydiv.childNodes[i+1]+mydiv.childNodes[i+2]
         }
  console.log(myString)
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I'm getting this at the console:
  [object Text][object HTMLElement][object Text]</p>