How to duplicate a div using jQuery?

To duplicate a div in jQuery, use the jQuery clone() method.


You can try to run the following code to learn how to duplicate a div using jQuery:

Live Demo

<!DOCTYPE html>
<script src=""></script>

<div>This is a text</div>
<button>Clone div and append</button>


Updated on: 10-Dec-2019

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started