0
I am making an application using Javascript and Jquery, and when I put an Alert to display an error in a div, it does not disappear, just by clicking on the x to close, I would like to know how to make it disappear after some time.
Código HTML
<div id="erro" class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" onclick="$('#erro').hide()">×</button>
IP fora da faixa, por favor, digite dois IP's válidos
</div>
Código JavaScript
$("#erro").show();
Look, I find it interesting to wait for the user to click on the X, so he will be aware of the message. If he gets distracted and the message disappears on its own, he may not know what happened. Besides, if you want the message to go away on its own, you don’t need the X button.
– Sam