The provided documentation offers a glimpse into the markup structure created when a tooltip is generated:
Markup
The markup for a tooltip is relatively straightforward, with the default position being set to top
by the plugin.
<div class="tooltip">
<div class="tooltip-inner">
Tooltip!
</div>
<div class="tooltip-arrow"></div>
</div>
Based on this example, identifying the CSS selector should be quite simple.
When inspecting the tooltip element using your browser's DOM inspector while hovering over your form element, you'll notice additional class names appended to .tooltip
. For instance, the tooltip in the provided example has the following classes attached: .tooltip fade right in
.
<div class="tooltip fade right in" style="…">
To target only the tooltip associated with a specific trigger element, the selection process depends on where the tooltip appears within the DOM structure. According to the documentation, tooltips are typically placed after their triggering element:
Usage
The tooltip plugin dynamically generates content and markup as needed, positioning tooltips after their respective triggers by default.
In this scenario, the selector would be .mytrigger + .tooltip
, where .mytrigger
represents the form element that activates the tooltip. The positioning within the DOM is influenced by the container
option unless otherwise specified.