JavaScript Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Java-Script Tutorial
Introduction Introduction
Variables Variables
Operators Operators
Statements Statements
Loops Loops
Functions Functions
Objects Objects
Arrays Arrays
Cookies JS Cookies
Browser Objects Browser Objects
Form DOM Form DOM
Style Objects DOM Style Objects
Forums Ask Your Doubts
Scraps More about Javascript
Feedback Feedback
 




Document Object Properties


Tutorials Javascript

Topic

Document object properties associated with it!



Explanation
The complete html portions that a user can write and display on a browser window forms the document object in javascript. It is the parent to access any html element.

The following are its properties.
PropertyDescriptionExample
alinkColor Property "alinkColor" is used to set and get value for alink attribute of body tag. Code To Set:
e.g: document.alinkColor = "green";

Code To Get:
e.g: var dd = document.alinkColor;

Test
anchor Property "anchor" is the object reference of an anchor contained in the document.  
anchors Property "anchors" is used to get an array of all the anchor objects in the document. Code To Get:
var dd = document.anchors;
var total = dd.length;

Test
bgColor Property "bgColor" is used to set background color or get the background color attribute of body tag. Code To Set:
document.bgColor = "blue";

Code To Get:
var dd = document.bgColor;

Test
cookie Property "cookie" is used to identify the value of a cookie.  
domain Property "domain" is used to get the domain name of the server from which the document is loaded. Code To Get:
var dd = document.domain;

Test
more properties in the next page.....





A Note
Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

Other Links

web hosting