| Methods or Attribute |
HTML |
JavaScript |
|
| Open a document |
|
document.open() |
|
| Write HTML |
|
document.write("HMTL") |
|
| Write HTML followed by new line |
|
document.writeln("HMTL") |
|
| Clean the document |
|
document.clear("HMTL") |
|
| Close the document |
|
document.close("HMTL") |
|
| Set color of active links |
alink=#rrggbb |
document.alinkColor="rrggbb" |
|
| Set color of background |
bgcolor=#rrggbb |
document.bgColor="rrggbb" |
|
| Set color of text |
text=#rrggbb |
document.fgColor="rrggbb" |
|
| Set color of unvisited links |
link=#rrggbb |
document.linkColor="rrggbb" |
|
| Set color of visited links |
vlink=#rrggbb |
document.vlinkColor="rrggbb" |
|
| Get an anchor |
|
= document.anchors[0] |
(v1.1) |
| Length of anchors array |
|
= document.anchors.length |
(v1.1) |
| Get an applet |
|
= document.applets[0] |
(v1.1) |
| Length of applets array |
|
= document.applets.length |
(v1.1) |
| Get an embed |
|
= document.embeds[0] |
(v1.1) |
| Length of embeds array |
|
= document.embeds.length |
(v1.1) |
| Get an image |
|
= document.images[0] |
(v1.1) |
| Length of images array |
|
= document.images.length |
(v1.1) |
| Sets the documents title |
<title>Title</title> |
document.title="Title" |
|
| Get domain of document |
|
= document.domain |
(v1.1) |
| Get the URL of the current document |
|
= document.location |
|
| Get the URL of the document the calling document |
|
= document.referrer |
|
| Get the width of the current docuement |
|
= document.width |
* |
| Get the height of the current document |
|
= document.height |
* |