IFrame sandbox Property

❮ IFrame Object

Example

Return the value of the sandbox attribute:

var x = document.getElementById("myFrame").sandbox;
Try it Yourself »

Description

The sandbox property returns the value of the sandbox attribute in an iframe element.

The sandbox attribute is used to enable security restrictions for iframes with untrusted content (such as scripts and forms).

If specified as an empty string (sandbox=""), the sandbox attribute enables a set of extra restrictions for the content in the inline frame.

The value of the sandbox attribute can either be an empty string (all the restrictions is applied), or a space-separated list of pre-defined values that will REMOVE particular restrictions.

Note: This property is read-only.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
sandbox 4.0 10.0 17.0 5.0 15.0

Syntax

iframeObject.sandbox

Technical Details

Return Value: A String, representing the value of the sandbox attribute

Related Pages

HTML reference: HTML <iframe> sandbox attribute


❮ IFrame Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.