title: How do I remove a div that I dynamically create using javascript
body: <pre><code>function adddiv {
     var c1 = document.getElementById('area1').value;
     var divElement = document.createElement("div");  
     divElement.id = "myDiv";  
     divElement.className = "myDivClass";  
     divElement.innerHTML = c1;  
     document.body.appendChild(divElement);
  }
  </code></pre>
  
  <p>above is my code to add div dynamically with button.</p>
  
  <p>how would I remove the divs dynamically with button?</p>