I want to display an alert box multiple times with a button click event without having to refresh the page but the alert box only shows up once. If I want to show the alert box
You can add .hidden
class to you alert and then toogle it. See: JSFiddle
HTML
Show Alert
JavaScript
$("#show-my-alert, .close").click(function() {
$("#my-alert").toggleClass("hidden");
});