IFrame seamless Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:IFrame

Description

The seamless property sets or gets whether an <iframe> has no borders or scrollbars.

This property reflects the HTML seamless attribute.

Set the seamless property with the following Values

Value Description
true|false Sets whether an iframe has no borders or scrollbars
  • true - The iframe should have no borders or scrollbars
  • false - Default. Have borders or scrollbars

Return Value

A Boolean, returns true if the iframe looks like it is a part of the containing document, otherwise it returns false

The following code shows how to check if an <iframe> looks like it is a part of the containing document (no borders or scrollbars):

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<iframe id="myFrame" src="http://java2s.com">
  <p>Your browser does not support iframes.</p>
</iframe>/* ww w.j  a  v a  2  s  .  c om*/

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myFrame").seamless;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials