aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/5.2/getting-started/javascript.md
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2022-12-01 09:59:45 +0200
committerGitHub <[email protected]>2022-12-01 09:59:45 +0200
commitd16efb79b69dddaa4320f59f966a176f3fe9e8fb (patch)
tree62b382d035b66d082b87a98ec997b7dd26a51407 /site/content/docs/5.2/getting-started/javascript.md
parent7c7f6ea933d398382555d9d877790a4d85c4546b (diff)
downloadbootstrap-d16efb79b69dddaa4320f59f966a176f3fe9e8fb.tar.xz
bootstrap-d16efb79b69dddaa4320f59f966a176f3fe9e8fb.zip
Update javascript.md (#37566)
Diffstat (limited to 'site/content/docs/5.2/getting-started/javascript.md')
-rw-r--r--site/content/docs/5.2/getting-started/javascript.md13
1 files changed, 9 insertions, 4 deletions
diff --git a/site/content/docs/5.2/getting-started/javascript.md b/site/content/docs/5.2/getting-started/javascript.md
index c4ba6b0f7..80eed9ce1 100644
--- a/site/content/docs/5.2/getting-started/javascript.md
+++ b/site/content/docs/5.2/getting-started/javascript.md
@@ -125,7 +125,6 @@ All constructors accept an optional options object or nothing (which initiates a
```js
const myModalEl = document.querySelector('#myModal')
-
const modal = new bootstrap.Modal(myModalEl) // initialized with defaults
const configObject = { keyboard: false }
@@ -302,11 +301,17 @@ const tooltip = new bootstrap.Tooltip(yourTooltipEl, {
**You don't need jQuery in Bootstrap 5**, but it's still possible to use our components with jQuery. If Bootstrap detects `jQuery` in the `window` object, it'll add all of our components in jQuery's plugin system. This allows you to do the following:
```js
-$('[data-bs-toggle="tooltip"]').tooltip() // to enable tooltips, with default configuration
+// to enable tooltips with the default configuration
+$('[data-bs-toggle="tooltip"]').tooltip()
-$('[data-bs-toggle="tooltip"]').tooltip({ boundary: 'clippingParents', customClass: 'myClass' }) // to initialize tooltips with given configuration
+// to initialize tooltips with given configuration
+$('[data-bs-toggle="tooltip"]').tooltip({
+ boundary: 'clippingParents',
+ customClass: 'myClass'
+})
-$('#myTooltip').tooltip('show') // to trigger `show` method
+// to trigger the `show` method
+$('#myTooltip').tooltip('show')
```
The same goes for our other components.