--- title: document.mozFullScreenElement slug: Web/API/Document/fullscreenElement translation_of: Web/API/DocumentOrShadowRoot/fullscreenElement original_slug: Web/API/DocumentOrShadowRoot/fullscreenElement ---

{{ ApiRef() }}

概述

返回当前文档中正在以全屏模式显示的{{ domxref("Element") }}节点,如果没有使用全屏模式,则返回null.

语法

var element = document.mozFullScreenElement;

示例

function isVideoInFullsreen() {
  if (document.mozFullScreenElement && document.mozFullScreenElement.nodeName == 'VIDEO') {
    console.log('您的视频正在以全屏模式显示');
  }
}

辅助

查看使用"全屏模式"页面了解详情.

浏览器兼容性

{{Compat("api.Document.fullscreenElement")}}