Reputation: 3
I'm using SweetAlert and it's working fine in my page with this button:
<button type="button" id="button1" onclick='swal("Message", "This is a message")'>Title</button>
But I want the message to popup when somebody enter the page without having to press a button.
What do I have to do?
Thanks
Upvotes: 0
Views: 57
Reputation: 8396
Try this:
<script>
$( document ).ready(function() {
swal("Message", "This is a message");
});
</script>
Upvotes: 0
Reputation: 163
<script>
window.onload = function(){
swal("Message", "This is a message");
}
</script>
You can try include this to your html document! Hope this can help!
Upvotes: 1