Search code examples
javascriptjqueryajaxtwitter-bootstrapboo

Bootstrap alert is only working one time


i am working on a web app in which after submit it calls a ajax page.Now if email is already present then it will throw alert.For this purpose I am doing bootstrap alert.But its working for the first time.Please see this bootply, When you press the add button then alert displays only first time.


Solution

  • .fadeOut() implicitly sets display: none;, thus you'll have to revert that, for example by calling .show().

    $(".alert").show().delay(200).addClass("in").fadeOut(3500);