HTMLIFrameElement: allowFullscreen 属性

可用性有限

此特性不是基线特性,因为它在一些最广泛使用的浏览器中不起作用。

HTMLIFrameElement 接口的 allowFullscreen 属性是一个布尔值,它反映了 <iframe> 元素的 allowfullscreen 属性,指明是否允许 iframe 的内容使用 requestFullscreen()

注意: 此属性被视为一个旧属性。请使用 allow="fullscreen"HTMLIFrameElement.allow 替代。

一个布尔值。

示例

html
<iframe id="el" allowfullscreen></iframe>
js
const el = document.getElementById("el");
console.log(el.allowFullscreen); // Output: true

规范

规范
HTML
# dom-iframe-allowfullscreen

浏览器兼容性

另见