Use the keyboard as well as the mouse: Tab, Shift+Tab, Enter and Escape.
Focus is on:
The non-modal dialog opens in the corner and the page stays usable: try clicking these buttons again while it is open. Escape does nothing to it. The modal dialog makes the rest of the page inert, dims it with ::backdrop, and closes on Escape.
Each button submits the dialog's form. Nothing is sent over the network: the dialog closes, and the submitting button's value becomes the dialog's returnValue. Escape closes it too, and leaves the value unchanged.
Last returnValue:
These buttons carry commandfor and command. Where invoker commands are supported, the browser opens and closes the dialogs itself; elsewhere, the fallback script at the end of this page wires the same buttons by hand. The second dialog has closedby="any": a click on the backdrop closes it, where supported.
Opened by: