Move an element into another element

For Example, You can Move an element into another element...

Demo

I'm a Blue Box.
I'm a Yellow Box.

HTML

<div id="blueBox">
        I'm a Blue Box.
</div>
<div id="yellowBox">
        I'm a Yellow Box.
</div> 
<button onclick="move();">Move</button>

CSS

#blueBox { 
        background-color:green; 
        color: #FFF; 
        display:inline-block; 
        padding:50px; 
}
#yellowBox { 
        background-color:yellow; 
        color: #333; 
        display:inline-block; 
        padding:30px; 
}
/* Small Devices, Tablets */
@media only screen and (max-width : 767px) {
        #blueBox, 
        #yellowBox { 
                display: block; 
                text-align:center; 
                margin-bottom: 15px; 
        }
}

Jquery

function move() {
        jQuery("#yellowBox")
                .detach()
                .appendTo('#blueBox');
}

Copyright 2016 by WebiBeris.com. All Rights Reserved.