title: connectedCallback vs window.load
body: <p>What event comes first if custom element is included in plain HTML body?</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-js lang-js prettyprint-override"><code>const elem = document.getElementById('test');
  
  window.addEventListener('load', () =&gt; {
    elem.innerHTML = 'window.load';
  });
  
  class myDiv extends HTMLElement {
    connectedCallback() {
      elem.innerHTML = 'connectedCallback';
    }
  }
  
  customElements.define('my-div', myDiv);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;my-div id="test"&gt;&lt;/my-div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Looks like <code>window.load</code> always comes last.</p>