Document Object:
The complete html portions that a user can write and display on a browser
window forms the document object in javascript. Document object is the parent to
access any html element.
The following are the properties that
can be used with document object.
Property
Description
Example
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.....
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.