title: How to save div elements into a array?
body: <p>I want to save my div child elements text content into an array using Javascript. Can anyone help me out? Thanks in advance!</p>
  
  <pre><code>&lt;div id="messages"&gt;
    &lt;div&gt;test&lt;/div&gt;
    &lt;div&gt;test&lt;/div&gt;
    &lt;div&gt;test&lt;/div&gt;
    &lt;div&gt;test&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>var messages = ["test", "test", "test", "test"];
  </code></pre>