In a prototype or Javascript compatible standard, but cross-browser, how do I move the contents of a div to the contents of another div?
Inside the div there is a form with identifiers and dependent Javascript code with event observers. I don't want this to break because I moved the block to the DOM. A 'this is innerHTML = that innerHTML' solution is not what I'm looking for. I will also need to do this when the DOM boots up.
I want to go from this:
<div id='here'> <div id='MacGuffin'> <p>Hello Worlds!</p> </div> </div> <div id='there'> </div>
:
<div id='here'> </div> <div id='there'> <div id='MacGuffin'> <p>Hello Worlds!</p> </div> </div>
... when the document loads without a jump.
javascript prototypejs
ʍǝɥʇɐɯ
source share