HTML exercise: Popovers without JavaScript — This page has no JavaScript. What happens when you tap "Tuning tip"?
The exercise
This page has no JavaScript. What happens when you tap "Tuning tip"?
1<button type="button"
2 popovertarget="tuning-tip">
3 Tuning tip
4</button>
5<div id="tuning-tip" popover>
6 <p>Tune up to the note, not down.</p>
7</div>
Solution
Answer: The hidden tip box opens on top of the page
An element with popover starts hidden, and a button with popovertarget opens or closes it without JavaScript. Because popovertarget="tuning-tip" matches the id, tapping the button shows the tip on top of the page.