Comparison
What is the difference between show() and showModal()?
showModal() opens a **modal** dialog: it goes into the top layer above every other element, gets a ::backdrop, makes the rest of the page inert and closes on Esc. show() opens a **non-modal** dialog in normal page flow: the page behind it stays clickable and Esc does nothing. Use showModal() for confirm boxes and forms that need an answer.
| Topic | showModal() | show() |
|---|---|---|
| Kind | Modal | Non-modal |
| Position | Top layer, centred, above any z-index | Normal flow, where the element sits |
| Rest of the page | Inert: no clicks, no focus, hidden from screen readers | Still usable |
::backdrop | Yes | No |
| Esc key | Fires cancel, then closes | Does nothing |
:modal pseudo-class | Matches | Does not match |
open attribute | Set | Set |




