Thuộc tính frameBorder của HTML DOM
定 nghĩa và cách sử dụng
Thuộc tính frameBorder có thể thiết lập hoặc trả về liệu viền xung quanh iframe có hiển thị hay không.
Đặt thuộc tính này thành 0 để có được khung không có viền.
Cú pháp
iframeObject.frameBorder=1|0
Ví dụ
Ví dụ này có thể thiết lập xem iframe có viền hay không:
<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="Xóa viền" /> <input type="button" onclick="restoreBorder()" /> value="Khôi phục viền" /> </body> </html>