title: JS For-Loop Cloning Too Many Times
body: <p>EDITED: (I identified the problem that was previously being discussed in the comments)</p>
  
  <p>my code is as follows:  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          for(var i=0; i&lt;5; i++){
              $(".image-wrap").clone().appendTo(".container").attr('id', ("reason" + i));
          }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>for some reason, when I use this approach, I get a div with class of "image-wrap" and ID of "reason0" as expected, but then there are two instances of "image-wrap" with "reason1" and then four instances of "image-wrap" with "reason2," and so on and so forth. What's wrong with my loop?</p>