title: After click on button show in the *div* the text as heading 1 <h1>, second click <h2> etc. After 6, is next text (7th) as <h1> again
body: <p>I want to make a website with text box, button using switch -case and div with id 'divResult'. If you click on button it shows  text from text box as heading 1 <code>&lt;h1&gt;</code>, after second click as <code>&lt;h2&gt;</code> etc. After 6, is next text (7th) as <code>&lt;h1&gt;</code> again. It works correct only last step (text in h1-h6) doesn't work. </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;meta charset="utf-8"&gt;
    &lt;title&gt;7-3&lt;/title&gt;
    &lt;script &gt;
      
  var index = 1;
  var countClicks = 0;
  
  window.onload = function () {
    document.getElementById('btnKnop').onclick = function () {
  
      var newElement = document.createElement('div');
      newElement.id = 'div' + index++;
      
      var node = document.getElementById('txtElement').value;
      var newNode = document.createTextNode(node);
      
      newElement.appendChild(newNode);
  
      
      console.log(newElement);
      document.getElementById('divResult').appendChild(newElement);
  
  
    countClicks++;
    switch (countClicks) {
      case 1: {
        console.log('heading text 1');
        break;
      }
      case 2:{
        console.log('heading text 2');
        break;
      }
      case 3:{
        console.log('head text 3');
        break;
      }
      case 4:{
        console.log('heading text 4');
        break;
      }
      case 5:{
        console.log('heading text 5');
        break;
      }
      case 6:{
        console.log('heading text 6');
        countClicks = 0;
        break;
        }
      }
         
    };
  };  
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;input type="text" id="txtElement"&gt;
    &lt;button id="btnKnop"&gt;Add&lt;/button&gt;
    &lt;div id="divResult"&gt;&lt;/div&gt;
    
  
  &lt;/body&gt;
  
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>