Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

duplicate images in webpage js

<div id="list"><img id="item" src = "picture.jpg"></div>

<script type="text/javascript">
  function cloneItem() {
      var item = document.getElementById("item");
      var list = document.getElementById("list");
      var clonedItem = item.cloneNode(true);
      list.appendChild(clonedItem);
  }

  for(var i = 0; i < 5; i++) {
    cloneItem();
  }
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #duplicate #images #webpage #js
ADD COMMENT
Topic
Name
1+3 =