title: JS - How to add a button into a div with appendChid
body: <p>I want to create a sidebar using only JavaScript, but I can't add the close button to the div.
  I tried this:</p>
  
  <pre><code>var sideb = document.createElement("Div");
      sideb.style.height = "100%";
      sideb.style.width = "0px";
      sideb.style.backgroundColor = "rgb(30,30,30)";
      sideb.style.top = "0px";
      sideb.style.right = "0px";
      sideb.style.margin = "0px";
      sideb.style.padding = "0px";
      sideb.style.position = "fixed"
  
      document.body.appendChild(sideb);
  
  var close = document.createElement("Button");
      close.innerText = "close";
      close.onclick = close;
  
      document.body.sideb.appendChild(close)
  </code></pre>
  
  <p>But it's not working.</p>