должно быть таким с ajax:
<div class="alert alert-danger light alert-dismissable" id="Deactive" style="display: none;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
</button>
<center><strong><h3>comment, </strong> comment</h3></center>
</div>
Вы можете сначала назначить ему идентификатор и вызвать с идентификатором «нет» и установить для них время ожидания
$(document).on('submit', '#form_id', function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: "API",
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
success: function(response) {
var obj = jQuery.parseJSON(response);
$("#Deactive").show();
window.setTimeout(function() {
$("#Deactive").hide();
}, 2000);
}
});
});