title: How to add specfic elements to to HTML containers using DOM
body: <p>I'm doing the Odin Project and am stuck on an exercise.</p>
  <p>The requirement is that I have to add specific elements to a container in the HTML file but I can't get the following sections to show up at all when I run it:</p>
  <p>a <code>&lt;div&gt;</code> with a black border and pink background color with the following elements inside of it:</p>
  <p>another <code>&lt;h1&gt;</code> that says “I’m in a div”
  a <code>&lt;p&gt;</code> that says “ME TOO!”</p>
  <p>Hint for this one: after creating the <code>&lt;div&gt;</code> with createElement, append the <code>&lt;h1&gt;</code> and <code>&lt;p&gt;</code> to it before adding it to the container.</p>
  <p>Here's my code <a href="https://codepen.io/mohd057/pen/KKQWdYV" rel="nofollow noreferrer">https://codepen.io/mohd057/pen/KKQWdYV</a></p>
  <pre><code>const container = document.querySelector('#container');
  
  const myP = document.createElement(&quot;p&quot;);
  myP.style.color = &quot;red&quot;; 
  myP.textContent = &quot;Hey I'm red!&quot;; 
  
  const myH = document.createElement(&quot;h3&quot;)
  myH.style.color = &quot;blue&quot;; 
  myH.textContent = &quot;I'm a blue h3!&quot;; 
  
  container.appendChild(myP);
  
  container.appendChild(myH);
  
  const myDiv = document.createElement(&quot;div&quot;); 
  myDiv.setAttribute('style', 'border: black; background: pink;'); 
  
      const anotherH = document.createElement(&quot;h1&quot;); 
      anotherH.textContent = &quot;I'm in a div&quot;; 
      const anotherP = document.createElement(&quot;p&quot;); 
      anotherP.textContent = &quot;ME TOO!&quot;; 
  
      container.appendChild(myDiv);
  </code></pre>
  <p>Here's the link to the exercise <a href="https://www.theodinproject.com/lessons/foundations-dom-manipulation-and-events" rel="nofollow noreferrer">https://www.theodinproject.com/lessons/foundations-dom-manipulation-and-events</a> (struggling on questions 3, 1, and 2 are fine)</p>
  <p>Would love to know where I'm going wrong.</p>