title: in pure Javascript, how do I get all elements inside the body tag excluding a certain div and its children?
body: <p>I'm trying to find all the elements inside the body tag, but there is one element (div) that has a certain class type of "hidden" which I want to exclude it and its children from my array of elements.</p>
  
  <p>here is my var that contains all the elements in the body:</p>
  
  <pre><code>allTagsInBody = document.body.getElementsByTagName('*');
  </code></pre>
  
  <p>and here is the div that I want to exclude from this list:</p>
  
  <pre><code>&lt;div class="myHiddenElement"&gt; 
      &lt;button&gt;Click here&lt;/button&gt;
      &lt;div&gt; &lt;button&gt;Click here&lt;/button&gt; &lt;/div&gt;
      &lt;button&gt;Click here&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>the problem is that I don't know how many elements there are inside that div and how far nested they are. </p>