I would like to use bootstrap's styled alerts instead of the default javascript alerts.
How can I trigger the bootstrap alert instead of the regular alert in the following code?
<button type="button" onclick="alert('my message')">Click Me!</button>
<div class="alert alert-primary" role="alert">
my alternative message
</div>
I don't want to see the message inside the div constantly on the screen, only when I press the button.
Edit: the answer that I am looking for is: what should be the value of onclick attribute so that the message will appear ONLY after clicking the button.