Alert on html site

Asked

Viewed 233 times

-1

I’m trying to set up an alert on a website. For example, a screen appears within the site itself, where the person can click to no longer appear this message. I’ve searched enough on the Internet, but I only found alert in dialog box, but need in form of pop-up within the same page, without opening another page. :)

1 answer

0


You can use a Sweetalert to create your alerts easily:

function meuAlerta() {
Swal.fire('Eu sou um alerta!');
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>

<button onclick="meuAlerta()">Mostrar Alerta</button>

  • I wanted something already automatic, without having to click a button

  • Only call the function when opening the page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.