Results for “closure”
Small, practical examples. Search by task or narrow things down below.
Allow one disclosure in a named group to stay open
HTML: Matching details name attributes create an exclusive native accordion in supporting browsers.
HTML✓ Tested
Capture a surrounding value in a closure
Capture a surrounding value in a closure in a complete Rust program using the standard library.
Rust✓ Tested
Capture state in a closure
Capture state in a closure using a complete Go program with explicit sample inputs.
Go✓ Tested
Create a native disclosure
Use details and summary to show optional HTML content without JavaScript.
HTML✓ Tested
Expose a disclosure button’s expanded state
HTML: Keep aria-expanded synchronized with the controlled panel’s hidden state.
HTML✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a small React component and explicit browser behavior.
React✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested
Clone inert template content into the document
HTML: Template children stay out of the rendered document until their fragment is inserted.
HTML✓ Tested
Dismiss a modal with the Escape key
HTML: Native modal dialogs provide keyboard dismissal and return focus to their invoker.
HTML✓ Tested
Display a calculated form result
HTML: An output element can name the input controls contributing to its value.
HTML✓ Tested
Open and close a modal dialog
HTML: showModal places a dialog in the top layer and makes the rest of the document inert.
HTML✓ Tested