title: change document.createElement('div') to document.createDocumentFragment()
body: <pre><code>const allItemContainer = document.getElementById(&quot;all-items&quot;);
  data.pizza.forEach((item) =&gt; {
          let container = document.createElement(&quot;div&quot;);
          //container will contain &lt;div class='shop-item'&gt;
          container.classList.add(&quot;shop-item&quot;);
          container.id = item.id; //will add an id to the current div equal to the ID given in the json file
          let textHeading = document.createElement(&quot;span&quot;);
          textHeading.classList.add(&quot;shop-item-title&quot;);
          textHeading.appendChild(document.createTextNode(item.name));
  }
  container.appendChild(textHeading);
  allItemContainer.appendChild(container);
  });
  </code></pre>
  <p>I wish to change the <code>document.createElement()</code> to <code>document.createDocumentFragment()</code>. I tried changing it but I got an error:-
  <code>Uncaught (in promise) TypeError: Cannot read property 'add' of undefined</code>
  How do I add classList to this Fragment? I'm new to this. Please help.</p>