Clone Events and Data settings

Clone Events and Data settings


Hello,
I'm looking for a way to replace one element with another and have the
later retain the events and data values of the former.
For example:
Let's say I have element A and element B. I want to use jQuery to
replace element A with element B but also have the it copy all events
and data values from A to B.
Is this possible?
Any help would be appreciated