]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update nav-tab.md
authorJitan Gupta <hi@jitangupta.com>
Fri, 16 Jul 2021 05:50:50 +0000 (11:20 +0530)
committerMark Otto <otto@github.com>
Mon, 26 Jul 2021 15:07:27 +0000 (10:07 -0500)
Updated the from anchor tag to button in sample examples

site/content/docs/5.0/components/navs-tabs.md

index b839f9754f626d16f8a44375fa4291f7114f16b7..dd5a3e08a3086415d69e72e99bfe90ae7207fa7f 100644 (file)
@@ -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()