title: Add class for all parents element on native JavaScript
body: <p>If I have some ".blocks"</p>
  
  <pre><code>body
      section
          .main-container
              .container
                  .block
                  .blcok
  </code></pre>
  
  <p>And I need add className for all parents block, div, section, body.</p>
  
  <p>When I use jquwry I wrote like this:</p>
  
  <pre><code>    $(".block").parents().addClass('block-wrapp');
  </code></pre>
  
  <p>But now I must use native js.</p>
  
  <pre><code>window.onload = function() {
  
      let block = document.getElementsByClassName('block');
  
      for( let i = 0; i &lt; block.length; i++ ) {
          block[i].parentNode.classList.add('block-wrapp');
      }
  };
  </code></pre>
  
  <p>I try use</p>
  
  <pre><code>        let mainBlock = block[i].parentNode.className;
          console.log(mainBlock.parentNode);
  </code></pre>
  
  <p>But it doesn't work</p>