clone() in jQuery
This method copies the set of matched elements with all of its descendant elements and text nodes.
Syntax
$(selector).clone([withDataAndEvents][,deepWithDataAndEvents])
- withDataAndEvents - It denotes a Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
- deepWithDataAndEvents - It denotes a Boolean indicating whether event handlers and data for all children of the cloned element should be copied.