i have a submit button that , when the user hits the submit button i want to fire up a Div with fadein() in jquery, from the same function im calling another function called monthlyReport() , but this fadein div is being called after the montlyReport is called and its functionality is over
<script type="text/javascript">
$(function () {
$("#submitbtn").click(function () {
$("#loading").fadeIn();
monthlyReport($(this));
});
});
function monthlyReport(Obj1) {
//some transactions
alert('test');
}
<div id="loading">
<div id="loadingcontent">
<p id="loadingspinner">
Searching things...
</p>
</div>
</div>
my requirement here is that $("#loading").fadeIn(); should fire first and then monthlyReport() can continue with its transactions