Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML iframe sandbox attribute

HTML

Try it »

(More examples are at the bottom of the page)


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Chrome, and Safari support the sandbox attribute.

**Note:** Opera and Internet Explorer 9 and earlier versions do not support the sandbox attribute.


Definition and Usage

If an empty string is specified (sandbox=""), the attribute enables some additional restrictions on the content displayed in the iframe.

The value of the sandbox attribute can be either an empty string (which enables all restrictions) or a space-separated list of specified strings.

HTML5 improves the security of iframes through the sandbox attribute. The sandbox attribute can prevent untrusted web pages from performing certain actions.

Ian Hickson, editor of the HTML5 specification, discussed the benefits of sandbox, which can prevent the following actions:


Differences between HTML 4.01 and HTML5

The sandbox attribute is new in HTML5.


Syntax