title: Chrome - Performance Monitor - DOM Nodes keep on stacking
body: <p>I'm trying to get my head around - why is the DOM Nodes keeps on going up when I'm checking my website in the Performance Monitor. </p>
  
  <p>I've added this simple code that just looping on:</p>
  
  <p>1) adding and element to a wrap, 
  2) bind it with a click event. 
  3) removing it. </p>
  
  <p>but still the DOM Nodes are always up the I check the performance. 
  any thoughts? </p>
  
  <p><a href="https://i.stack.imgur.com/mQeoA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mQeoA.jpg" alt="image showing the issue and the monitor"></a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      
  
      &lt;title&gt;&lt;/title&gt;
      &lt;style&gt;
          .wrap{
              font-size:50px;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body &gt;
      &lt;div class="wrap"&gt;
          &lt;div&gt;&lt;/div&gt;
      &lt;/div&gt;
      
  
     &lt;script&gt;
         var counter = 0;
  
         setInterval(function () {
  
             //increase counter (for display) 
             counter++;
  
             //get wrap 
             var wrap = document.getElementsByClassName("wrap")[0];
  
             //remove its children
             while (wrap.firstChild) {
                 wrap.firstChild.removeEventListener("click", onclick);
  
                 wrap.removeChild(wrap.firstChild);
             }
  
             //create new element 
             var div = document.createElement("div");        // create a div element
             div.innerHTML = 'hello mosh (' + counter + ')';
             
             //bind events
             div.addEventListener("click", onclick);
  
             // append the div to wrap
             wrap.appendChild(div);                                
  
  
  
         }, 200);
  
         //on click function
         var onclick = function () { alert('click'); }
  
     &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>