How to close a modal window automatically?

-1

I would like to know if there is any way to close a modal window, without clicking "Close" ?, for example, if the window is a form and it returns a successful message, it would be good if it closes automatically after 2 seconds.

    
asked by Ricardo Pastuszek 19.09.2018 в 01:22
source

1 answer

-1

I would recommend using the sweetalert library, it is very good for sending messages without clicking on a button.

 swal({
  title: "¡mensaje!",
  timer: 2000 ,
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.0/sweetalert.min.js"></script>
    
answered by 19.09.2018 / 01:43
source