Document Object Properties

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.....

Ask Questions

Ask Question