Document Property & Method

Document object, properties associated with it

Explanation

continue...
more properties that can be used with document object.

PropertyDescriptionExample
embedsProperty "embeds" is return an array containing all the plugins contained in the document.
Code To Get:
var dd = document.embeds;
alert(dd.length);

Test
fgColorProperty "fgColor" is used to set/get the foreground color attribute of body tag.Code To Get:
var dd = document.fgColor;

Code To Set:
document.fgColor = "fefaaa";


Test
formProperty "form" is the object reference of a form object contained in the document.
formsProperty "forms" is used to get an array of all the form objects in the document page. Code To Get:
var dd = document.forms;
var length1 = dd.length;

Test
imageProperty "image" is the object reference of an image object contained in the document.
imagesProperty "images" is used to get an array of all the image objects in the document or web page. Code To Get:
var dd = document.images;
var img = dd[0].width;

Test
linkProperty "link" is the object reference of a link object contained in the document.
linksProperty "links" is used to get an array of all the link objects in the document or web page. Code To Get:
var dd = document.links;
var link1 = dd[0];

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

Ask Questions

Ask Question