Disclosure without script

Click a summary, or Tab to it and press Enter or Space.

What this browser supports

Feature checks run by the page's script. A "no" means the widget falls back to plainer behavior, not that it breaks.

details / summary
checking…
details name (exclusive)
checking…
beforematch event
checking…
::details-content
checking…
interpolate-size
checking…

1. Plain disclosure

The first starts closed. The second carries the open attribute, so it starts open; the browser adds and removes the attribute as you toggle.

What does the summary do?

It is the always-visible toggle. Everything after it inside the details element is shown or hidden.

Why does this one start open?

Because the markup says <details open>. Close it and look at the element in DevTools: the attribute is gone.

2. An exclusive accordion

All three share name="trail". Opening one closes whichever was open; closing the open one leaves all three closed.

Which trail is shortest?

The Lake Loop, at 3 km.

Which trail is steepest?

The Ridge Path, which climbs 400 m in its first kilometre.

Are dogs allowed?

On a lead, on every trail except the Marsh Boardwalk.

3. Find in page reaches closed content

The details below is closed. Press Ctrl+F (Command+F on a Mac) and search for quillwort. The first matches are in this paragraph; press Enter to move to the next one, which is inside the closed details. Where the browser supports it, the details opens to show the match. A text fragment does the same: this link to the word inside the details opens the demo in a new tab, because browsers apply text fragments only in a top-level page.

Plants of the Marsh Boardwalk

Sedges, bog bean, sundew and the rare lake quillwort, which grows underwater at the edge of the pond.

4. A restyled marker, animated where supported

The triangle is replaced by a plus and a minus. Where ::details-content is supported, the content slides open; elsewhere it simply appears.

Opening hours

The visitor centre is open from 9:00 to 17:00, every day but Monday.

Parking

The main car park holds 120 cars and fills by 10:00 on summer weekends.

The toggle events

Each details fires toggle after it opens or closes. In the accordion, opening one item logs two events: one for the item you opened, one for the item the browser closed. A details that starts open fires one as the page loads.

No toggle events yet.