How to move a div above a section?

How to move a div above a section?

Hi everyone, 

I'm new to JQuery and this group and I'm hoping someone can help. I have some content that is generated by software and I need to change the order of one part. I need to move a div above a section. I've tried a few things but have been unsuccessful so far. I'm not sure if it is because I'm dealing with a section or because of a mistake on my part. 

I need to move the custom-header-container div above the main-section section. What is the correct way to do it?

<section class="main-section">
<div class="row outer-row" data-mc-content-body="True">
<div class="row" id="custom-header-container">


I have tried this (and variations of it), but no joy:

$(document).ready(function(){
    $("custom-header-container").insertBefore("main-section");

});