Moving content of one div into another div

by Akram kamal

HTML

<div id="box1">Parent One
    <div class="child">Child text</div>
</div>
<div id="box2">Parent Two</div>

CSS

#box1 {
      background-color: red;
      width: 200px;
      height: 200px;
      margin: 5px auto;
      text-align: center;
      padding-top: 70px;
  }
  #box2 {
      background-color: yellow;
      width: 200px;
      height: 200px;
      margin: 5px auto;
      text-align: center;
      padding-top: 70px;
  }
  .child {
      background-color: blue;
      width: 60%;
      margin: 10px auto;
  }

JavaScript

$(function () {
        $('#box1>.child').appendTo($('#box2'));
    });