Skip to content
Justice Tech School

Tooltips and Popovers

Tooltips and popovers use Popper and must be turned on with JavaScript because they are opt in for performance.

Example
<button class="btn btn-secondary" data-bs-toggle="tooltip" title="Helpful hint">Hover me</button>
<script>
  document.querySelectorAll('[data-bs-toggle="tooltip"]')
    .forEach(el => new bootstrap.Tooltip(el));
</script>

Exercise

Create a tooltip.

new bootstrap.(el)

Quiz Test

Why do tooltips need JavaScript setup?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.