Move Div

Move a div inside another div

by Abhishek Singh

HTML

<div id="example-one">
  <ul class="nav">
    <li class="nav-one"><a href="#featured" class="current">Billing Address</a></li>
  </ul>
  <div class="list-wrap">
    hello
  </div>
</div>
<div id="new-div">The new div now has the example-one's content</div>

JavaScript

r(function() {
  var exampleDiv = document.getElementById("example-one");
  var newDiv = document.getElementById("new-div");
  newDiv.appendChild(exampleDiv);
});

function r(f) {
  /in/.test(document.readyState) ? setTimeout('r(' + f + ')', 9) : f()
}