A
Austin Matzko
Given one DOM element, el1, what's the most robust way to retrieve
another arbitrarily associated element, el2?
It seems that it's common just to create a custom property, like so:
el1.myAssociatedElement = el2
However, from what I understand this creates potential problems: some
browsers may disallow such expando properties, and they could lead to
memory leaks.
The best I've been able to think of is to loop through a multi-
dimensional array of the associated elements:
[[el1, el2], [el3, el4], ... ]
Is there a better way?
another arbitrarily associated element, el2?
It seems that it's common just to create a custom property, like so:
el1.myAssociatedElement = el2
However, from what I understand this creates potential problems: some
browsers may disallow such expando properties, and they could lead to
memory leaks.
The best I've been able to think of is to loop through a multi-
dimensional array of the associated elements:
[[el1, el2], [el3, el4], ... ]
Is there a better way?