Complete the code to select the tab element by its ID.
const tabTrigger = document.getElementById('[1]');
The getElementById method selects the element with the specified ID. Here, the tab's ID is tab1.
Complete the code to create a new Bootstrap Tab instance for the selected element.
const tab = new bootstrap.Tab([1]);The variable tabTrigger already holds the tab element, so we pass it directly to bootstrap.Tab.
Fix the error in the code to show the tab programmatically.
tab.[1]();The correct method to show a Bootstrap tab programmatically is show().
Fill both blanks to add a click event listener that shows the tab when clicked.
tabTrigger.addEventListener('[1]', () => { tab.[2](); });
The event to listen for is click, and the method to show the tab is show().
Fill all three blanks to select a tab by CSS selector, create a Tab instance, and show it.
const tabElement = document.querySelector('[1]'); const tabInstance = new bootstrap.Tab([2]); tabInstance.[3]();
We select the tab with ID #profile-tab, pass the element variable tabElement to create the Tab instance, then call show() to display it.
