I got a request for removing a div and showing an alert. Therefore, my first code is as follows:
$(document).ready(function(){
$('#headerDiv').hide();
alert('something wants to say');
});
It didn't the hide div before the alert in chrome and edge, so I change the alert line to
setTimeout(function(){
alert('something wants to say');
},100);
It works fine but I want to know why it happens. Furthermore, I think the problem can occur again depending on computer performance, so I want to know if there is any quality fix or not.