How to write a script to access document properties using IE4 DOM method?

This IE4 document object model (DOM) introduced in Version 4 of Microsoft's Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features.


To access document properties using IE4 DOM method, try to run the following code −

      <title> Document Title </title>
            function myFunc()
               var ret = document.all["heading"];
               alert("Document Heading : " + ret.innerHTML );
               var ret = document.all.tags("P");;
               alert("First Paragraph : " + ret[0].innerHTML);
      <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 d = "form2" name = "SecondForm">
         <input type="button" value="Don't ClickMe"/>