how to show the only the loding.gif on (onclick) with flask backend?

Solution
 $('#submit_leave_email').submit(function(e) {
    $("#will_hide").hide();
    $('#loading').show();
    setTimeout(()=>{
       $('#loading').replaceWith("");
    }, 3000)
    e.preventDefault();
 });