Skip to content

Commit

Permalink
docs(dom/document): fixed #274
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed May 4, 2024
1 parent eefffcf commit 2f55be8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/dom/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ document.scrollingElement.scrollTop = 0;
`document.fullscreenElement`属性返回当前以全屏状态展示的 DOM 元素。如果不是全屏状态,该属性返回`null`

```javascript
if (document.fullscreenElement.nodeName == 'VIDEO') {
if (
document.fullscreenElement &&
document.fullscreenElement.nodeName == 'VIDEO'
) {
console.log('全屏播放视频');
}
```
Expand Down

0 comments on commit 2f55be8

Please sign in to comment.