instance method Element#clone

View source on GitHub →

Element#clone(deep) → Element
  • deep (Boolean) – Whether to clone element's descendants as well.

Returns a duplicate of element.

A wrapper around DOM Level 2 Node#cloneNode, Element.clone cleans up any expando properties defined by Prototype.

This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.