The HTML allow attribute
Quick answer
The HTML allow attribute sets a Permissions Policy controlling which features the framed content may use. It is used on the <iframe> element.
Overview
The allow attribute sets a Permissions Policy controlling which features the framed content may use. It applies to the <iframe> element.
It controls powerful features (camera, microphone, geolocation, fullscreen, autoplay) inside the frame, replacing older one-off attributes like allowfullscreen for fine-grained control.
Syntax
<iframe src="map.html" allow="geolocation"></iframe>
Values
| Value |
|---|
A Permissions-Policy directive list, e.g. camera 'none'; fullscreen *; geolocation 'self'. |
Best practices
Frequently asked questions
What does the allow attribute do?
Sets a Permissions Policy for an iframe.
How do I make an iframe secure?
How do I embed inline HTML in an iframe?
Which elements use the allow attribute?
It is an element-specific attribute, used on the <iframe> element.