0
0
Bootsrapmarkup~5 mins

Tooltip component in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a tooltip in web development?
A tooltip is a small pop-up box that appears when a user hovers over or focuses on an element. It shows extra information about that element.
Click to reveal answer
beginner
How do you enable a tooltip in Bootstrap 5?
You add the attribute data-bs-toggle="tooltip" to an element and initialize tooltips with JavaScript using var tooltip = new bootstrap.Tooltip(element);.
Click to reveal answer
beginner
Which event triggers a Bootstrap tooltip by default?
The tooltip appears when the user hovers over or focuses on the element.
Click to reveal answer
intermediate
How can you change the position of a Bootstrap tooltip?
Use the data-bs-placement attribute with values like top, bottom, left, or right to position the tooltip.
Click to reveal answer
intermediate
Why is it important to include aria-label or aria-describedby with tooltips?
These attributes help screen readers understand the tooltip content, making your site accessible to users with disabilities.
Click to reveal answer
Which attribute activates a Bootstrap tooltip on an element?
Atooltip-enable="yes"
Bdata-toggle="popover"
Cdata-bs-toggle="tooltip"
Ddata-bs-tooltip="true"
What JavaScript code initializes all tooltips on a page in Bootstrap 5?
Anew bootstrap.Tooltip(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
Bbootstrap.Tooltip.initAll()
Ctooltip.init()
Dvar tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl); });
Which attribute controls the position of a Bootstrap tooltip?
Adata-bs-placement
Bdata-bs-position
Ctooltip-position
Dplacement-bs
What event usually shows a tooltip in Bootstrap by default?
ADouble click
BHover or focus
CClick
DScroll
Why should tooltips include ARIA attributes?
ATo help screen readers understand tooltip content
BTo make tooltips visible on mobile
CTo improve SEO ranking
DTo speed up page loading
Explain how to add and initialize a tooltip on a button using Bootstrap 5.
Think about the HTML attributes and the JavaScript code needed.
You got /3 concepts.
    Describe how to make tooltips accessible for users with screen readers.
    Accessibility means helping all users understand content.
    You got /3 concepts.