HTML & CSS · Senior · Question 53 of 75
What does the popover attribute give you?
<button popovertarget="menu">Menu</button>
<div id="menu" popover>...</div>- ✓Correct answer: A top-layer element with light dismiss (Esc, outside click) and toggling without JavaScript
- 2A tooltip that follows the cursor
- 3A modal dialog that blocks the rest of the page
Explanation
The top layer sits above all z-index stacking contexts, so overflow and stacking bugs disappear. Unlike <dialog> with showModal(), a popover doesn't make the rest of the page inert.