I have the following html code and this is a part of the html
<div id="mount"
<span> please wait while we are loading...</span>
</div>
and I have a main submit button
<div id="MainContentbutton" class="buttonscontainer" data-kaction="submitdiv" style="display:block";>
<input type="submit" name="MainContentbtnsubmit" value="submit" id="MainContentbtnsubmit"
class="submitbutton" onbeforesubmit="Application_onbeforeSubmit" data-kaction="submit" style="font-weight:bold;>
<div>
I wanted to hide the button by using
display:none
and this should hide only when the following div is loaded.
div id="mount"
I am trying to find the solution and learn in the process.
In your Js file or wherever you load the data when the result comes in you can do it like this:
// this function is to fake the loading
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
delay(1000).then(() {
var mount = document.getElementById('mount');
var submitButton = document.getElementById('MainContentbtnsubmit');
mount.css({'display' : 'none'});
submitButton.css({'display' : 'block'});
});
Don't forget to set the display of the button to none, in line css.