By default, Bootstrap popovers are triggered by a click event on the target element.
Hover and focus can be used but require configuration.
<button id="infoBtn" type="button" class="btn btn-primary">Info</button>
The correct way is to use new bootstrap.Popover(element, options) with options title and content.
Option C uses wrong keys and selector type, C uses a non-existent method, and A uses an undefined constructor.
<button id="btn" type="button" class="btn btn-secondary" data-bs-toggle="popover" data-bs-placement="left" data-bs-content="Popover on left">Click me</button> <script>var popoverTrigger = document.getElementById('btn'); var popover = new bootstrap.Popover(popoverTrigger);</script>
The data-bs-placement="left" attribute sets the popover to appear on the left side of the button.
aria-haspopup="true" tells assistive technologies that the element triggers a popup like a popover.
aria-expanded is used for expandable content but must be toggled dynamically.
.popover. You want to write CSS that styles only popovers currently visible on the page. Which selector correctly targets visible popovers?Bootstrap adds the show class to popovers when they are visible.
Option D correctly targets visible popovers.
Option D is incorrect because fade is for animation, not visibility.
Option D uses an attribute not set by Bootstrap.
Option D uses a non-existent CSS pseudo-class.