Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Alerts > Live Example section #34769

Merged
merged 4 commits into from
Aug 30, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 2 additions & 12 deletions site/content/docs/5.1/components/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,10 @@ Alerts are available for any length of text, as well as an optional close button

Click the button below to show an alert (hidden with inline styles to start), then dismiss (and destroy) it with the built-in close button.

{{< example >}}
<div id="liveAlertPlaceholder"></div>

<div class="bd-example">
<button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button>
</div>

```html
<button type="button" class="btn btn-primary" id="liveAlertBtn">Show live alert</button>

<div class="alert alert-primary alert-dismissible" role="alert" id="liveAlert">
<strong>Nice!</strong> You've triggered this alert.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
```
{{< /example >}}

We use the following JavaScript to trigger our live alert demo:

Expand Down