How to put this JS alert to appear when entering the page

0

Well, I've found this custom alert on a site, and I'm looking forward to putting it on my page, to enter the page, the alert will appear.

I could not follow the site statement, because in their example it's about to appear when I click on a button, and I do not understand anything about Javascript.

I'll want to use the second example:

swal("Here's the title!", "...and here's the text!");

Someone could make a template as an answer for me to put on my page, thank you!

    
asked by anonymous 10.12.2017 / 19:10

3 answers

2

One way to do this is to add this library to HTML and use it globally.

See:

swal("Meu alerta", "Olá alerta :D !");
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

Ifollowedthe guide instructions .

    
10.12.2017 / 19:21
1

Look at this example: It's simple! Now you just customize with your information.

link

    
10.12.2017 / 19:26
0

How do you add an alert when you zero the numbers?

<button id="bcen" onclick="this.textContent --;" value="10000">10000</button>
<script>
document.getElementById("bcen").style.align = "center"; // Center
document.getElementById("bcen").style.width =
"300px"; //Size
document.getElementById("bcen").style.align = "center"; // Center
document.getElementById("bcen").style.height =
"200px"; //Size
</script>
    
27.07.2018 / 04:09