jquery appendto

You can use the jquery appendto method to insert one element into another. In this example the 'movethis' paragraph is inserted into the 'main' div at the end.

Move this paragraph

Opening paragraph

Code

<p id="movethis">Move this paragraph</p>
<div class="main">
<p>Opening paragraph</p>

</div>

<button type="button" onclick="appendfunc()" >Go!</button>
<script>
function appendfunc()
{
$( "#movethis" ).appendTo( $( ".main" ) );
}
</script>