1. You would keep a pointer to the span, in each ChatUser object.
2. You would have *some* unique ID passed from server->client
to identify which user its talking about. A session ID say.
this could be used to lookup the ChatUser object.
>> "It's a contrived example, but I hope it illustrates the importance of associations. There are multiple workarounds for this situation. But they aren't elegant, which is why I think JS sucks :]"Nope, and I actually think your proposed method - mapping ChatUser->span is incredibly ugly and inelegant. Horrible design. A ChatUser object should know what UI elements it is in control of directly.