Skip to content
Advertisement

Set IFrame allowfullscreen with javascript

I tried to set allowfullscreen attribute to the iframe, but it doesn’t work:

iframe.allowFullScreen = true

I checked it with chrome -> inspect element, but the iframe has no allowfullscreen attribute, after this code.

Thanks in advance,

Advertisement

Answer

iframe.setAttribute('allowFullScreen', '')

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement