Clone HTML Elements X Times – Duplicate.js

Category: Javascript | March 26, 2019
Views Total:588 views
Official Page:Go to website
Last Update:March 26, 2019


Clone HTML Elements X Times – Duplicate.js


Duplicate.js is a dead simple JavaScript library to duplicate/clone HTML html elements x times using repeat() method.

How to use it:

Insert the Duplicate.js script right before the closing body tag.

<script src="duplicate.js"></script>

Create an element to be cloned and specify the clone times in the data-duplicate attribute:

<div data-duplicate="10">
  <p> Hello World </p>

You Might Be Interested In:

Leave a Reply