ExampleClone all p elements and insert them at the end of the body element:
Try it yourself » |
The clone() method makes a copy of selected elements, including child nodes, text and attributes.
$(selector).clone(includeEvents) |
Parameter | Description |
---|---|
includeEvents | Optional. A boolean value that specifies whether or not
the event handlers should be copied. By default, event handlers are not included in the copy. |
![]() |
Try it Yourself - Examples |
Copy an element including event handlers
How to use the clone() method to copy an element, including event handlers.