HTML DOM frameBorder 屬性

定義和用法

frameBorder มีความหมายว่าเพื่อตั้งค่าหรือคืนค่าว่าจะแสดงเขตขอบรอบ iframe หรือไม่

จัดตั้งค่านี้เป็น 0 สามารถได้รับแบบตัวกรองหรือมีเขตขอบ

การใช้งาน

iframeObject.frameBorder=1|0

ตัวอย่าง

ตัวอย่างนี้สามารถตั้งค่าว่า iframe จะมีเขตขอบหรือไม่

<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>