You can put something as a key, but before actual use it is always converted to a string, and this string is used as a key. So, if you look at what domObject.toString() produces, you see that this is not a good candidate. If all your dom objects have an identifier, you can use this identifier. If not, and you still need a key based on the DOM object, you could probably use, for example, the _counter attribute with an automatic counter in the background, adding a new unique value to the DOM object if _counter is not already present.
user1046334
source share