Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:35:30+00:00 2026-06-05T21:35:30+00:00

I want to display an alert box multiple times with a button click event

  • 0

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 again, I have to refresh page.

Currently if you render a bootstrap alert on the page, when you close it, the div container of the alert is gone from the page. So when you click the button again, it doesn’t show up anymore. I have been doing the following on the close button to make it hide instead of delete the div container of alert.

<button class="close" onclick="$('#alertBox').hide();; return false;">×</button>

I wonder if using data-toggle or data-dismiss in bootstrap can make this sort of toggle effect working without going through my own custom Javascript handlers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:35:32+00:00Added an answer on June 5, 2026 at 9:35 pm

    I’ve had the same problem: just don’t use the data-dismiss from the close button and work with JQuery show() and hide():

    $('.close').click(function() {
       $('.alert').hide();
    })
    

    Now you can show the alert when clicking a button by using the code:

    $('.alert').show()
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display the alert box but for a certain interval. Is it
I want to display a form in a Div, in alert box. How would
When we want to display the output of the javascript function on Alert Box.
How do i display a countdown timer in my alert box .i want to
I want to display a message box with an OK button. I used the
I want to display special chars as an alert box using javascript and jsp...
I want to display a alert message when a user clicks on button. I
I want after click on link show alert box with tow option ok and
I want to display the alert dialog box to device screen size. I got
How do i display a countdown timer in my alert box .i want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.