IE, DHTML, onclick, and anonymous functions
So! I’m using the DOM to create dynamic popups, and I’ve just discovered that in order to create something that will work across all browsers without having to tell IE that an element is itself, you should us an anonymous function, i.e.:
myNewNode.onclick = function(){alert("Testing!");};
After adding the onclick property of the node (NOT via using setAttribute), you may *then* add the node as an appropriate child node to other elements on the page. Or, assuming that you’ve kept a reference to the node and didn’t simply leave it on the heap somewhere known only to JavaScript, you may add it later 