How to script access document properties using IE4 DOM methods?

WBOY
Release: 2023-08-28 13:39:15
forward
999 people have browsed it

如何使用IE4 DOM方法编写脚本访问文档属性?

The IE4 Document Object Model (DOM) was introduced in version 4 of the Microsoft Internet Explorer browser. IE 5 and above support most basic W3C DOM features.

Example

To access document properties using IE4 DOM methods, try running the following code -

<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&#39;t ClickMe"/>
      </form>
   </body>
</html>
Copy after login

The above is the detailed content of How to script access document properties using IE4 DOM methods?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!