title: How to get all text from all tags in one array?
body: <p>I need to create an array which contains all text from a page without jQuery. This is my html: </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Hello world!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Hello!&lt;/h1&gt;
      &lt;p&gt;
          &lt;div&gt;What are you doing?&lt;/div&gt;
          &lt;div&gt;Fine, and you?&lt;/div&gt;
      &lt;/p&gt;
      &lt;a href="http://google.com"&gt;Thank you!&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is what i want to get</p>
  
  <pre><code>text[1] = "Hello world!";
  text[2] = "Hello!";
  text[3] = "What are you doing?";
  text[4] = "Fine, and you?";
  text[5] = "Thank you!";
  </code></pre>
  
  <p>Here is what i have tried but seems to not work correctly in my browser:</p>
  
  <pre><code>var elements = document.getElementsByTagName('*');
  console.log(elements);
  </code></pre>
  
  <p>PS. I need to use document.getElementsByTagName('*'); and exclude "script" and "style".</p>