Skip to content

Commit

Permalink
Simpler tooltip initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
fulldecent authored Oct 19, 2024
1 parent 5c2f2e7 commit 8407b24
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions site/content/docs/5.3/components/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ Got all that? Great, let's see how they work with some examples.
As mentioned above, you must initialize tooltips before they can be used. One way to initialize all tooltips on a page would be to select them by their `data-bs-toggle` attribute, like so:

```js
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => new bootstrap.Tooltip(el));
```

### Tooltips on links
Expand Down

0 comments on commit 8407b24

Please sign in to comment.