I want to display div on page load e.g."campaign-alert", but I am not able to do this .
This is sample code :
<div id="popup">
<div id="campaign-alert" style="display:none;">
.
.
.
</div>
</div>
I have tried this way as well :
document.getElementById('campaign-alert').style.display="";
document.getElementById('campaign-alert').style.display="block";
Can anybody help me in this ?
Try this. It will help you.
Using Jquery
$(document).ready(function () {
$("#campaign-alert").show();
});
Using JavaScript
window.onload = function () {
document.getElementById("campaign-alert").style.display = "block";
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With