S
sneill
I know its possible to dynamically remove elements from the DOM, but
rather than deleting them forever, is it possible to 'capture' them and
save them as an object variable so they can be reused elsewhere?
Consider this...
There are 2 DIV tags with the same ID value.
Wouldn't it be a neat trick if you could move one of the DIV tags out
to an object variable so that a getElementById() would return a result
for DIV tag that remained? Swapping the first DIV tag object back and
repeating the process on the second would return the first DIV tag on a
getElementById().
I tried cloning a DOM element by creating a clone() prototype function
on the Object object, but that didn't work.
Any ideas anyone?
Steve
rather than deleting them forever, is it possible to 'capture' them and
save them as an object variable so they can be reused elsewhere?
Consider this...
There are 2 DIV tags with the same ID value.
Wouldn't it be a neat trick if you could move one of the DIV tags out
to an object variable so that a getElementById() would return a result
for DIV tag that remained? Swapping the first DIV tag object back and
repeating the process on the second would return the first DIV tag on a
getElementById().
I tried cloning a DOM element by creating a clone() prototype function
on the Object object, but that didn't work.
Any ideas anyone?
Steve