I've traditionally used JavaScript as "UI Glue", and have (regrettably) been one of those that looked at JS as a "toy". However, I've changed course and am finding some real power in its use - especially coupled with JSON/jQuery.
My question involves dynamically creating elements, then appending them to the DOM. It seems that when this happens, only a copy of the object is appended to the DOM and I lose the reference to it. For example, if I create a global object using createElement (say, "a"), set a few attributes ("href", "title", etc.) and then append it into the DOM, any original reference to my global object has no impact on the appended element. I'm sure that I could find the object I just inserted, but this seems like more work than it should be. Am I missing something?