From 83058fb34c7f0f3ea8855cbf510d6da22280b4d3 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 4 Aug 2019 12:05:04 +0200 Subject: [PATCH] explain how to use bootstrap 5 with jQuery --- site/content/docs/4.3/getting-started/javascript.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/content/docs/4.3/getting-started/javascript.md b/site/content/docs/4.3/getting-started/javascript.md index 4e3e793dbf..a6fd3d92df 100644 --- a/site/content/docs/4.3/getting-started/javascript.md +++ b/site/content/docs/4.3/getting-started/javascript.md @@ -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/). +## 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 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.) -- 2.47.2