fullscreenElement
Summary
Exposes the current fullscreen state, returning the element that is displayed fullscreen, or null if there is no such element.
Property of dom/Documentdom/Document
Syntax
Note: This property is read-only.
var element = document.fullscreenElement;
Return Value
Returns an object of type ElementElement
Returns the element that is displayed fullscreen, or null
if there is no such element.
Examples
function inFullScreen() {
if (document.fullscreenElement == null) {
// no element is in full-screen mode
return false;
}
else {
// an element is in full-screen mode
return true;
}
}
Related specifications
- W3C Fullscreen
- Working Draft
Related specifications
See also
Tutorial: Using the full-screen API