jQuery Copy/Clone/Duplicate Html Elements

jQuery Copy/Clone/Duplicate Html Elements

jQuery duplicate/copy/clone html element; In this jQuery tutorial you will learn how to copy selected HTML elements like div, span, button, paragraph tag etc using jQuery clone () method.

jQuery Copy/Clone/Duplicate Html Elements

The jQuery clone () method is used to create copies of the selected html elements. It also makes copies of it’s child nodes, texts and attributes. The clone () method is a easy way to copy the elements on a webpage.



Parameters of clone() method

  • True :- Specifies that the event handler should also be copied.
  • False :- This is a default parameter. Specifies that the event handler should not be copied.

Example clone() method

This example will demostrate you how to copy selected html elements using clone () method.

<!DOCTYPE html>  
<title>jQuery Clone Method</title> 
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> 
<style type="text/css">
    padding: 15px;
    border: 12px solid #23384E;
    background: #28BAA2;
    margin-top: 10px;
<div class="container">
<p id="a_clone"><b> This is simple example of clone method.</b></p>  
<p id="b_clone"><b>Note:</b>Click here, to clone c_clone id of elements, and append them to the b_clone id of element</p>  
<button id="btn_clone">Click Me!</button>  


Demo Clone Method

This is simple example of clone method.

Note:Click here, to clone c_clone id of elements, and append them to the b_clone id of element

In the above clone() method example, First of all When you click on button that copy of selected html elements.

Recommended jQuery Tutorials

  1. jQuery Text Method By Example
  2. Get and Set Input, Select box, Text, radio Value jQuery
  3. jQuery Replace Html Content, Text
  4. jQuery Animate() Effect Method By Example
  5. jQuery | Event MouseUp By Example
  6. Event jQuery Mouseleave By Example
  7. jQuery Event Mouseenter Example
  8. Event jQuery MouseOver & MouseOut By Example
  9. keyup jquery event example
  10. Jquery Click Event Method with E.g.
  11. Event jQuery. Blur By Example
  12. jQuery form submit event with example
  13. keydown function jQuery
  14. List of jQuery Events Handling Methods with examples
  15. Jquery Selector by .class | name | #id | Elements
  16. How to Get the Current Page URL in jQuery
  17. jQuery Ajax Get() Method Example
  18. get radio button checked value jquery by id, name, class
  19. jQuery Set & Get innerWidth & innerHeight Of Html Elements
  20. jQuery Get Data Text, Id, Attribute Value By Example
  21. Set data attribute value jquery
  22. select multiple class in jquery
  23. How to Remove Attribute Of Html Elements In jQuery
  24. How to Checked Unchecked Checkbox Using jQuery
  25. jQuery removeClass & addClass On Button Click By E.g.
  26. To Remove whitespace From String using jQuery
  27. jQuery Ajax Post Method Example
  28. jQuery Ajax Get Method Example
  29. To Load/Render html Page in div Using jQuery Ajax $.load
  30. jQuery Sibling Methods – To Find Siblings Elements
  31. jQuery Find Siblings Elements with Class, id


My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published.