Easy Tutorial
❮ Html Hasclass Sel Input Radio ❯

jQuery clone() Method

jQuery HTML/CSS Methods

Example

Clone all <p> elements and insert them at the end of the <body> element:

$("button").click(function(){
    $("p").clone().appendTo("body");
});

Definition and Usage

The clone() method creates a copy of the selected elements, including child nodes, text, and attributes.


Syntax

Parameter Description
true Specifies that event handlers should be copied.
false Default. Specifies that event handlers should not be copied.

More Examples

Copy Elements Including Event Handlers


jQuery HTML/CSS Methods

❮ Html Hasclass Sel Input Radio ❯