Example 1
Welcome div
(and test the focus trap).
ARIA
Role | Attribute | Element | Usage |
---|---|---|---|
dialog |
div |
Identifies the element that serves as the dialog container. | |
aria-labelledby= |
div |
Gives the dialog an accessible name by referring to the element that provides the dialog title. | |
aria-describedby= |
div |
|
|
aria-modal= |
div |
Tells assistive technologies that the windows underneath the current dialog are not available for interaction (inert). |
Keyboard Shortcuts
You can close it using Esc, or by using Enter or Space if you’re on the close button.
Mouse users can click outside the modal window to close it (this option can be disabled if needed).
If you never activate a modal window, it won’t be anywhere in the code.
Example 2
Woot, you can take the content of a hidden block.
