Complete the code to add a popover to the button using Bootstrap.
<button type="button" class="btn btn-primary" data-bs-toggle="[1]" title="Popover title" data-bs-content="Popover body content">Click me</button>
The attribute data-bs-toggle="popover" activates the popover on the button.
Complete the JavaScript code to enable all popovers on the page.
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]'); const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.[1](popoverTriggerEl));
Bootstrap's JavaScript class to create popovers is Popover.
Fix the error in the popover initialization code by filling the blank.
var popoverTrigger = document.getElementById('popoverBtn'); var popover = new bootstrap.Popover([1]);
The popover constructor needs the element reference, which is stored in popoverTrigger.
Fill both blanks to create a popover with a custom trigger and placement.
var popover = new bootstrap.Popover(document.getElementById('btn'), { trigger: '[1]', placement: '[2]' });
The trigger option can be set to focus to show popover on focus, and placement controls where the popover appears, e.g., top.
Fill all three blanks to create a popover with a title, content, and HTML enabled.
var popover = new bootstrap.Popover(document.getElementById('infoBtn'), { title: '[1]', content: '[2]', html: [3] });
Set title to 'Info', content to HTML string, and html to true to allow HTML content in the popover.