REVISED: (I have pinpointed the issue previously discussed in the comments)
this is the code I am working with:
<script type="text/javascript">
for(var i=0; i<5; i++){
$(".image-wrap").clone().appendTo(".container").attr('id', ("reason" + i));
}
</script>
oddly enough, when implementing this method, I end up with one "image-wrap" div having the ID of "reason0" as intended. However, subsequent repetitions result in two occurrences of "image-wrap" with "reason1," followed by four instances labeled "reason2," and so forth. Can you identify what may be causing my loop to malfunction?