pmsv pmsv <pm**@zmail.pt> writes:
is that the best way? There isn't a way to ckeck the attachEvents
without having to save history??
No. Unlike the simple "onclick" property, there is no way to get at
the events added with attachEvent (or the non-proprietary
addEventListener). You must even know them in order to remove them
with detachEvent (or removeEventListener).
I wouldn't use innerHTML to copy DOM nodes at all, though. I would
rather use the DOM method cloneNode with a true argument to make
it a deep clone.
In your case, you don't even make a copy, you just move the nodes.
You can do that directly:
while(d1.hasChildNodes()) {
d2.appendChild(d1.firstChild);
}
This has the advantage of moving the DOM nodes themselves, including
their attached event listeners.
It seems you are writing for IE only (using attachEvent). Otherwise,
you should remember to initialize the variables d1 and d2.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'