title: working with createDocumentFragment() without ids
body: <p>I'm trying to build the following using <code>createDocumentFragment()</code> and append it to <code>document.body</code>. My usual approach would be to reference an element by it's <code>id</code>. Since there are no <code>'id</code>s here, how do I build something like this?</p>
  <pre><code>&lt;div class=&quot;Mh0NNb VcC8Fc&quot; style=&quot;visibility:visible;&quot;&gt;
      &lt;div class=&quot;M6tHv&quot;&gt;
          &lt;div class=&quot;aGJE1b&quot;&gt;Success&lt;/div&gt;
          &lt;div class=&quot;dnmu6e&quot;&gt;&lt;/div&gt;
          &lt;div class=&quot;x95qze&quot;&gt;Close&lt;/div&gt;
          &lt;div class=&quot;dnmu6e&quot;&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  frag = document.createDocumentFragment();
  
  n = document.createElement('div')
  n.setAttribute('class','Mh0NNb VcC8Fc')
  frag.appendChild(n)
  
  n = document.createElement('div')
  n.setAttribute('class','M6tHv')
  a = frag.getElementsByClassName('Mh0NNb') // This seems to not work
  frag.appendChild(a)
  </code></pre>