title: Javascript clone duplicating div's in increments
body: <p>I am currently working on a web page and one of the features is that it allows users to add an extra div (which already exists) to the page by clicking on an image. The page is designed using Bootstrap 3.0</p>
  
  <p>This div already exists and when the image is pressed, it duplicates the div. This works fine if the user wants to duplicate the div once, but if they try to duplicate it twice, then the div is duplicated 4 times, and if they try it 3 times, the div is duplicating 8 times.</p>
  
  <p>Below is my Javascript code for duplicating the div -</p>
  
  <pre><code>function addRow() {
    var row = document.getElementById("row-to-clone");
    var clone = row.cloneNode(true);
  
    row.appendChild(clone);
  }
  </code></pre>
  
  <p>The row-to-clone is just the ID of the div that I want to duplicate, but I don't know why it is duplicating it more than once. Would anyone have any suggestions?</p>
  
  <p>Thanks.</p>