I have do some research online and find out that the below code can auto hide an alert:
function Testing()
{
$("#alertmsg").show();
$("#alertmsg").fadeTo(2000, 500).slideUp(500, function(){
$("#alertmsg").alert('close');
});
}
I have created a button to trigger the alert message:
<button class="btn btn-success" onclick="Testing()">Apply</button>
The problem is, it can only done once. What I mean is, when the page is loaded, and I click the button and the alert message will come out. And it will auto hide after a few seconds. After that when I press the button again in attempt to let the alert message come out, it fail already. Any idea what's wrong?