Description
As noted in this stackoverflow question:
The API for clone() says:
The .clone() method performs a deep copy of the set of matched
elements, meaning that it copies the matched elements as well as all
of their descendant elements and text nodes. For performance reasons,
the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied
to the cloned elements. The clone operation sets these fields to
their default values as specified in the HTML.
The docs appear to be wrong. User data typed into inputs is indeed copied to the cloned elements. I verified this with several tests. I could not get .clone() to not copy the value of a text input that whose value was empty in the HTML. The value of the cloned element must be explicitly cleared after cloning if this is the desired result.