vor jQuery anhängen
$( "h2" ).insertBefore( $( ".container" ) );
Friendly Flamingo
$( "h2" ).insertBefore( $( ".container" ) );
$('ElementBeforeYouWantToInsert').prepend('<div>the element you want to insert</div>');
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>before demo</title>
<style>
p {
background: yellow;
}
</style>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
<p> is what I said...</p>
<script>
$( "p" ).before( "<b>Hello</b>" );
</script>
</body>
</html>