HTML DOM frameBorder Attribute

Definition and Usage

The frameBorder property can set or return whether the border around the iframe is displayed.

Set this property to 0 to get a borderless frame.

Syntax

iframeObject.frameBorder=1|0

Example

This example can set whether the iframe has a border or not:

<html>
<head>
<script type="text/javascript">
function removeBorder()
  {
  document.getElementById("frame1").frameBorder="0";
  }
function restoreBorder()
  {
  document.getElementById("frame1").frameBorder="1";
  }
</script>
</head>
<body>
<iframe src="frame_a.htm" id="frame1"></iframe>
<br /><br />
<input type="button" onclick="removeBorder()" />
value="Remove border" />
<input type="button" onclick="restoreBorder()" />
value="Restore border" />
</body>
</html>

Try It Yourself (TIY)

Change iframe Border