JavaScript program to display all properties of document object

Write a JavaScript program to display all properties of "document" object.



Source Code
<HTML>
<HEAD>
    <TITLE>Document Properties</TITLE>
</HEAD>
<BODY>
<SCRIPT type="text/javascript">
    document.fgColor = "green";      // sets text color
    document.bgColor = "yellow";     // background color
    document.title = "Chakde India"; // change title
    document.linkColor = "navy";     // hyperlinks color
    document.alinkColor = "red";     // active links
    document.vlinkColor = "lime";    // visited hyperlinks
    document.write("<BR>Do you know about JavaScript?");
    document.write("<BR> <A href=\"yes.html\"> Yes </A>");
    document.write("<BR> <A href=\"no.html\"> No </A>");
    document.write("<BR>Title of current document: " + document.title);
    document.write("<BR>Height of current document: " + document.height);
    document.write("<BR>Width of current document: " + document.width);
    document.write("<BR> URL of current document is: " + document.URL);
    
    //Use of document.links to list of all the hyperlinks
    document.write("<BR><B>The List of Links in current document</B>");
    var links = document.links;
    for(var i = 0; i < links.length; i++)
    {
        document.write("<BR>"+ document.links[i]);
    }
</SCRIPT>
</BODY>
</HTML>
Output





"Coding Hub - Learn to code" app now available on Google Play Store