Javascript examples for DOM HTML Element:IFrame
The sandbox property returns the sandbox attribute in an iframe element.
This property is read-only.
A String, representing the value of the sandbox attribute
The following code shows how to return the value of the sandbox attribute:
<!DOCTYPE html> <html> <body> <iframe id="myFrame" src="http://java2s.com" sandbox="allow-scripts"> <p>Your browser does not support iframes.</p> </iframe>//ww w .j a va2 s.c o m <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myFrame").sandbox; document.getElementById("demo").innerHTML = x; } </script> </body> </html>