Wildcard digit with jQuery in form ID

I have this code (abbreviated) that renders from the Gravity Forms WordPress plugin with no hooks or other means of altering its output (other than forking the plugin):

<div class="gform_heading">...</div>
<form id="gform_8" action="/volunteer/">
    <div class="gform_body gform-body">...</div>
    <div class="gform_footer top_label">...</div>
</form

I need for the div class="gform_heading">...</div> to be a child of the <form> element:

<form id="gform_8" action="/volunteer/">
    <div class="gform_heading">...</div>
    <div class="gform_body gform-body">...</div>
    <div class="gform_footer top_label">...</div>
</form

I’m planning to use this jQuery to alter the DOM.

$(".gform_heading").prependTo("[id^=gform_]");

However, the site has multiple forms and the gform_... id has a number after the underscore that changes depending on the form rendered to the page. I need to wildcard the number in the jQuery so it can work for any form, present or future, that the site may embed into a page.

I tried the solution at Use wildcard ID with jQuery and get wildcard ID in my Inspector console (substituting my form ID and class names) but it didn’t work.

What would be the most correct way to do this?