Sandbox Attribute Description:
The sandbox attribute defines the restrictions on the content of the IFRAME element.
This attribute is valid in HTML5.
The Sandbox Attribute is Used with These Tags:
The Sandbox Attribute Contains:
The sandbox attribute defines the extra restrictions on the IFRAME. There are four values you can apply, separating multiple values with spaces:
allow-forms—allow form submissionallow-same-origin—allow scripts to access content like cookies from the same origin domainallow-scripts—allow scripts to run in thisIFRAMEallow-top-navigation—allow theIFRAMElinks and scripts to the_toptarget
Here is an example of an IFRAME with a sandbox attribute.
<iframe sandbox>
Your browser does not support iframes.
</iframe>
And one where forms are allowed to be submitted from the IFRAME:
<iframe sandbox="allow-forms">
Your browser does not support iframes.
</iframe>
Sandbox Default Value:
The sandbox attribute has no default value. If the sandbox attribute is present with none of the above keywords in place, then all restrictions are in place on the IFRAME.
Sandbox is Valid in HTML Versions:
- HTMl5
- XHTML5
Sandbox Attribute DTD:
HTML5
<doctype html>

