Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM IFrame sandbox Property

Improve Article
Save Article
Like Article
  • Last Updated : 17 Jun, 2022
Improve Article
Save Article
Like Article

The IFrame sandbox Property in HTML DOM is used for returning the value of the sandbox attribute in an iframe element. When the sandbox attribute exists, and it will:

  • treat the content as being from a singular origin
  • It blocks form submission
  • It blocks script execution
  • It disables APIs
  • It also preventing links from targeting other browsing contexts
  • It stop the content to navigate its top-level browsing context
  • block automatically triggered features (such as automatically playing a video or automatically focusing a form control)

The value of the sandbox attribute will either be simply sandboxed (then all restrictions are applied) or a space-separated list of pre-defined values which will take away the actual restrictions. Syntax: 


Return Value: It returns string Value Which representing the value of the sandbox attribute. 



<!DOCTYPE html>
        HTML DOM iframe sandbox Property
<body style="text-align:center;">
        HTML DOM iframe sandbox Property
    <button onclick="Geeks()">
    <p id="sudo"></p>
        function Geeks() {
            var iframeID = document.getElementById("GFG").sandbox;
            document.getElementById("sudo").innerHTML = iframeID;

  • Before Clicking on Button:


  • After Clicking on Button:


Supported Browsers: The browsers supported by HTML DOM IFrame sandbox Property are listed below:

  • Google Chrome 4.0 and above
  • Edge 12.0 and above
  • Firefox 17.0 and above
  • Internet Explorer 10.0 and above
  • Opera 15.0 and above
  • Safari 5.0 and above

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!