Clone HTML Elements X Times – Duplicate.js

Category: Javascript | March 26, 2019
Authorkaleidawave
Last UpdateMarch 26, 2019
LicenseMIT
Tags
Views598 views
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>
</div>

You Might Be Interested In:


Leave a Reply