aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/5.0/getting-started/javascript.md
diff options
context:
space:
mode:
authorRohit Sharma <[email protected]>2020-07-22 22:33:11 +0300
committerXhmikosR <[email protected]>2020-11-14 07:09:15 +0200
commit418f17ee2b849dafdc39623ba2378df9229164a7 (patch)
tree7446b75f6b2a8e8ad9f5f8ab8143b4d451c94a14 /site/content/docs/5.0/getting-started/javascript.md
parentfe961c192d951bde610cdcd4817f4d8548d33141 (diff)
downloadbootstrap-418f17ee2b849dafdc39623ba2378df9229164a7.tar.xz
bootstrap-418f17ee2b849dafdc39623ba2378df9229164a7.zip
Add `bs` in data attributes
- Add `bs` in data APIs everywhere - Update unit tests
Diffstat (limited to 'site/content/docs/5.0/getting-started/javascript.md')
-rw-r--r--site/content/docs/5.0/getting-started/javascript.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/site/content/docs/5.0/getting-started/javascript.md b/site/content/docs/5.0/getting-started/javascript.md
index 1b896103b..2235ec67e 100644
--- a/site/content/docs/5.0/getting-started/javascript.md
+++ b/site/content/docs/5.0/getting-started/javascript.md
@@ -39,7 +39,7 @@ Our dropdowns, popovers and tooltips also depend on [Popper.js](https://popper.j
## Still want 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 detects `jQuery` in the `window` object** it'll add all of our components in jQuery's plugin system; this means you'll be able to do `$('[data-toggle="tooltip"]').tooltip()` to enable tooltips. The same goes for our other components.
+Bootstrap 5 is designed to be used without jQuery, 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 means you'll be able to do `$('[data-bs-toggle="tooltip"]').tooltip()` to enable tooltips. The same goes for our other components.
## Data attributes
@@ -71,7 +71,7 @@ myModal.addEventListener('show.bs.modal', function (e) {
{{< callout warning >}}
## jQuery events
-Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-no-jquery` attribute set on `<body>`. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`.
+Bootstrap will detect jQuery if `jQuery` is present in the `window` object and there is no `data-bs-no-jquery` attribute set on `<body>`. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`.
```js
$('#myTab a').on('shown.bs.tab', function () {
@@ -208,8 +208,8 @@ var myDefaultAllowList = bootstrap.Tooltip.Default.allowList
// To allow table elements
myDefaultAllowList.table = []
-// To allow td elements and data-option attributes on td elements
-myDefaultAllowList.td = ['data-option']
+// To allow td elements and data-bs-option attributes on td elements
+myDefaultAllowList.td = ['data-bs-option']
// You can push your custom regex to validate your attributes.
// Be careful about your regular expressions being too lax