insert before jquery code example
Example 1: append before jquery
$( "h2" ).insertBefore( $( ".container" ) );
Example 2: jquery insert after
$( "<p>Test</p>" ).insertAfter( ".inner" );
$( "h2" ).insertBefore( $( ".container" ) );
$( "<p>Test</p>" ).insertAfter( ".inner" );