aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJitan Gupta <[email protected]>2021-07-16 11:20:50 +0530
committerMark Otto <[email protected]>2021-07-26 10:07:27 -0500
commite805a5e2879f95d75fefe1867f8ef7a36e3a299b (patch)
tree2d71198cc773aa1bca57567229d9edb401f9848f
parent9ef7ca51568372cde63094281738fe72f490e89d (diff)
downloadbootstrap-e805a5e2879f95d75fefe1867f8ef7a36e3a299b.tar.xz
bootstrap-e805a5e2879f95d75fefe1867f8ef7a36e3a299b.zip
Update nav-tab.md
Updated the from anchor tag to button in sample examples
-rw-r--r--site/content/docs/5.0/components/navs-tabs.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/site/content/docs/5.0/components/navs-tabs.md b/site/content/docs/5.0/components/navs-tabs.md
index b839f9754..dd5a3e08a 100644
--- a/site/content/docs/5.0/components/navs-tabs.md
+++ b/site/content/docs/5.0/components/navs-tabs.md
@@ -525,7 +525,7 @@ You can activate a tab or pill navigation without writing any JavaScript by simp
Enable tabbable tabs via JavaScript (each tab needs to be activated individually):
```js
-var triggerTabList = [].slice.call(document.querySelectorAll('#myTab a'))
+var triggerTabList = [].slice.call(document.querySelectorAll('#myTab button'))
triggerTabList.forEach(function (triggerEl) {
var tabTrigger = new bootstrap.Tab(triggerEl)
@@ -539,10 +539,10 @@ triggerTabList.forEach(function (triggerEl) {
You can activate individual tabs in several ways:
```js
-var triggerEl = document.querySelector('#myTab a[href="#profile"]')
+var triggerEl = document.querySelector('#myTab button[data-bs-target="#profile"]')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
-var triggerFirstTabEl = document.querySelector('#myTab li:first-child a')
+var triggerFirstTabEl = document.querySelector('#myTab li:first-child button')
bootstrap.Tab.getInstance(triggerFirstTabEl).show() // Select first tab
```
@@ -593,7 +593,7 @@ Activates a tab element and content container. Tab should have either a `data-bs
</div>
<script>
- var firstTabEl = document.querySelector('#myTab li:last-child a')
+ var firstTabEl = document.querySelector('#myTab li:last-child button')
var firstTab = new bootstrap.Tab(firstTabEl)
firstTab.show()