document.body

The page's <body> element as seen from JavaScript, the usual target for portals and the fallback when focus is lost.

In more detail

When a focused element is removed, focus falls back to document.body and keyboard users lose their place. Scroll locking also sets overflow on it.

Related terms

Taught in

References