如何编写脚本以使用IE4 DOM方法访问文档属性?
此IE4文档对象模型(DOM)在Microsoft的InternetExplorer浏览器的版本4中引入。IE5和更高版本包括对大多数基本W3CDOM功能的支持。
示例
要使用IE4DOM方法访问文档属性,请尝试运行以下代码-
<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>热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短