1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-24 14:13:06 +02:00

explain how to use bootstrap 5 with jQuery

This commit is contained in:
Johann-S
2019-08-04 12:05:04 +02:00
parent 8468f4a37e
commit 83058fb34c

View File

@@ -37,6 +37,10 @@ Some plugins and CSS components depend on other plugins. If you include plugins
Our dropdowns, popovers and tooltips also depend on [Popper.js](https://popper.js.org/). Our dropdowns, popovers and tooltips also depend on [Popper.js](https://popper.js.org/).
## Still wanting to use jQuery? It's possible!
Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. **If Bootstrap detect `jQuery` in the window object** it'll add all of our components in jQuery's plugin system, it means you'll be able to do: `$('[data-toggle="tooltip"]').tooltip()` to enable tooltips and the same goes for our other components.
## Data attributes ## Data attributes
Nearly all Bootstrap plugins can be enabled and configured through HTML alone with data attributes (our preferred way of using JavaScript functionality). Be sure to **only use one set of data attributes on a single element** (e.g., you cannot trigger a tooltip and modal from the same button.) Nearly all Bootstrap plugins can be enabled and configured through HTML alone with data attributes (our preferred way of using JavaScript functionality). Be sure to **only use one set of data attributes on a single element** (e.g., you cannot trigger a tooltip and modal from the same button.)