open Commandopen [fullscreen] [<expression>]
The open command opens an element. It automatically detects the element type and calls the right API:
<dialog> — calls showModal()<details> — sets the open attributepopover attribute — calls showPopover()fullscreen — calls requestFullscreen() on the target, or on document.documentElement if no target is given.open() as a fallbackIf no target is given, defaults to me.
<button _="on click open #my-dialog">Open Dialog</button>
<dialog id="my-dialog">
<p>Hello!</p>
<button _="on click close #my-dialog">Close</button>
</dialog>
<button _="on click open #info">Show Details</button>
<details id="info"><summary>Info</summary><p>Details here</p></details>
<button _="on click open fullscreen">Go Fullscreen</button>
<button _="on click open fullscreen #video">Fullscreen Video</button>