Free Training
C Language   |   CSS   |   MainFrame   |   VBScript   |   PHP   |   XML   |   C++ Tutorials   |   Ajax   |   JavaScript   |   CSS3   |   UML   |   jQuery   |   Microsoft AJAX

Sponsored Links

JavaScript Tutorials

 
Home Tutorials JavaScript
 

JavaScript Document Object Properties

 

JavaScript Document Object Properties

Page 1 of 3

JavaScript Document Object Properties

In this JavaScript tutorial, you will learn about Document Object Properties viz. formName, forms, images, lastModified, layers, linkColor, links, plugins, referrer, title, URL and vlinkColor.


formName:

Using the formName property, any form in the document can be referred and the formName is assigned as <FORM NAME = "formID">.


General syntax for using the formName property is as follows:



document."formname"



forms:

When a programmer wants to refer all the Form objects in a current document, then he or she can make use of the forms property. The forms property is an array that gives reference to all Form objects associated with the current document.


General syntax for using the forms property is as follows:



document.forms["formID"]



images:

When a programmer wants to refer all the Image objects in a current document then he or she can make use of the forms property. The images property is an array that gives reference to all Image objects associated with the current document.


General syntax for using the images property is as follows:



document.images["imageID"]



lastModified:

The lastModified property returns the document's last modified date and time.


General syntax for using the lastModified property of a document object is as follows:



document.lastModified



for example



<html>
   <
body>
      <
script type="text/javascript">
          
document.write("Last Modified Date and Time of the Document is: " + document.lastModified);     


      </script>
   </
body>
</
html>




The output of the above program is



Last Modified Date and Time of the Document is : 12/10/2006 10:04:28



In the above program, the latest modified date and time of the document displays.


Next Page: Properties: layers, linkColor, links, plugins and referrer


Read Next: JavaScript Document Object Methods Part I



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links