Using JavaScript methods
In the list at the beginning of this chapter, we saw that all interactive components have methods. In the official documentation of Bootstrap 5, you will find a table describing all of the available methods for each component. In this table, you will find the name and description for each method. You can access the components in the official documentation through this link: getbootstrap.com/docs/5.2/components.
Now, we will see some examples of how to use specific methods for the tooltip component. In our example page, we first have a default tooltip component for comparison. The HTML for this is as follows:
part-3/chapter-11/examples/methods/index.html line 15
<div class="badge bg-secondary" id="tooltipDefault" title="Default tooltip">Badge with default tooltip</div>
The tooltip has the id="tooltipDefault"
attribute, which we use to initialize it with the following JavaScript:
part-3/chapter...