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.
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.
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>