源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <script> function removeBorder(){ document.getElementById("myframe").frameBorder="0"; } </script> </head> <body> <iframe id="myframe" src="/?demo"> <p>你的瀏覽器不支持iframes。</p> </iframe> <br><br> <input type="button" onclick="removeBorder()" value="移除邊界"> <p><b>注意:</b> 該實例不能工作在IE瀏覽器。</p> </body> </html>
運行結果