如何編寫指令碼來利用 IE4 DOM 方法訪問文件屬性?
Microsoft Internet Explorer 瀏覽器的第 4 版中引入了此 IE4 文件物件模型 (DOM)。Internet Explorer 5 及更高版本支援大多數基本的 W3C DOM 功能。
示例
要使用 IE4 DOM 方法訪問文件屬性,請嘗試執行以下程式碼 −
<html>
<head>
<title> Document Title </title>
<script>
<!--
function myFunc()
{
var ret = document.all["heading"];
alert("Document Heading : " + ret.innerHTML );
var ret = document.all.tags("P");;
alert("First Paragraph : " + ret[0].innerHTML);
}
//-->
</script>
</head>
<body>
<h1 id = "heading">This is main title</h1>
<p>Click the following to see the result:</p>
<form id="form1" name = "FirstForm">
<input type = "button" value = "Click Me" onclick = "myFunc();" />
<input type = "button" value = "Cancel">
</form>
<form d = "form2" name = "SecondForm">
<input type="button" value="Don't ClickMe"/>
</form>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP