The only thing I can think of is generating a GUID for each element and assigning it to a custom attribute such as "data-my-custom-attribute", which is kinda what jQuery does to keep track of elements. Then you could traverse the DOM on each side and create a dictionary that relates both sides.
↧