Search
 
SCRIPT & CODE EXAMPLE
 

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript null Conversion to Number 
Javascript :: three ways of writing a function in javascript 
Javascript :: create java script array 
Javascript :: remove all chars from string and leave only numbers javascript and leav space betwin numbers 
Javascript :: Jquery check if hover over child element 
Javascript :: export to csv - Javascript - Download CSV as File 
Javascript :: json schema bsp 
Javascript :: svg event listeners 
Javascript :: angular autofocus 
Javascript :: datatable buttons bootstrap 4 
Javascript :: add image inside a div on specific position javascript 
Javascript :: loop through elements by name js 
Javascript :: append a method to an already existing class in javascript 
Javascript :: ERROR TypeError: By.Subject is not a constructor 
Javascript :: string to char code array javascript 
Javascript :: js remove trailling lines 
Javascript :: run another process on nodejs process exit 
Javascript :: escape double quotes in json 
Javascript :: Printer Print using HTML 
Javascript :: window.focus and window.blur jquery 
Javascript :: cross origin http://localhost forbidden jest 
Javascript :: lodash omitby 
Javascript :: jquery toggle visibility 
Javascript :: nodejs mysql error handling with user example 
Javascript :: Symbol Methods javascript 
Javascript :: Create Your Vue Project 
Javascript :: jest tocontain 
Javascript :: vuejs enter phone with country flag 
Javascript :: find all even numbers javascript 
Javascript :: textinput onpress react native 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =