mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
querySelector will only select the first element. Adjust to QuerySelectorAll
This commit is contained in:
parent
2f734af472
commit
285ff5ebf9
@ -532,9 +532,11 @@ If no tab was already active, the `hide.bs.tab` and `hidden.bs.tab` events will
|
||||
</table>
|
||||
|
||||
```js
|
||||
var tabEl = document.querySelector('a[data-bs-toggle="list"]')
|
||||
tabEl.addEventListener('shown.bs.tab', function (event) {
|
||||
var tabElms = document.querySelectorAll('a[data-bs-toggle="list"]')
|
||||
tabElms.forEach(function(tabElm) {
|
||||
tabElm.addEventListener('shown.bs.tab', function (event) {
|
||||
event.target // newly activated tab
|
||||
event.relatedTarget // previous active tab
|
||||
})
|
||||
})
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user