bootstrap set active tab javascript

To set an active tab in Bootstrap using JavaScript, you can use the following code:

// Get the tab element
var tab = document.getElementById('tab-id');

// Activate the tab
tab.classList.add('active');

Replace 'tab-id' with the actual ID of the tab you want to activate. This code adds the 'active' class to the tab element, which is the class used by Bootstrap to indicate an active tab.

Please note that this code assumes you have already included the Bootstrap CSS and JavaScript files in your HTML document.