|
JavaScript Document Object
The JavaScript Document object is the container for all HTML HEAD and BODY objects associated within the HTML tags of an HTML document.
Document Object Properties
Document Object Methods
- clear() - This is depreciated.
- close() - Closes an output stream that was used to create a document object.
- contextual() - It can be used to specify stype of specific tags. The following example specified that text in blockquotes is to be blue:
document.contextual(document.tags.blockquote).color = "blue";
Multiple styles may be specified in the contextual method to set the value of text in a H3 tag that is underlined to the color blue, for example.
document.contextual(document.tags.H3, document.tags.U).color = "blue";
- elementFromPoint(x, y) - Returns the object at point x, y in the HTML document.
- getSelection() - Get the selected text (if any is selected).
- open([mimeType]) - Opens a new document object with the optional MIME type.
- write(expr1[,expr2...exprN]) - Add data to a document. Writes the values passed to the write function to the document.
document.write("<H3>")
document.writeln("This is a Header")
document.write("</H3>")
- writeln(expr1[,expr2...exprN]) - Adds the passed values to the document appended with a new line character.
Events
- onafterupdate
- onbeforeupdate
- onClick
- ondblclick
- ondragstart
- onerrorupdate
- onhelp
- onkeydown
- onkeypress
- onkeyup
- onmousedown
- onmousemove
- onMouseOut
- onMouseOver
- onmouseup
- onreadystatechange
- onrowenter
- onrowexit
- onselectstart
|
|
Document Object Objects
- activeElement
- all - All HTML elements in the document.
- anchors - An array of all the anchors in the document.
- applet - A JAVA applet to be used in the document.
- area - An object specifying an image map area contained in the document.
- body
- embeds
- form - An object that specifies a form in the document.
- forms - An array of all the forms in the document.
- frames - An array that consists of all the frame objects in the document.
- images - An array of the images in the document.
- image - An image in a document. Properties of the image:
- border - The width of the border around the image in pixels.
- complete - A boolean value which identifies whether an image is completely loaded yet.
- height - The read only height of the image in pixels.
- hspace - The read only amount of horizontal space to the left and right sides of the image.
- lowsrc - The read or write string giving the URL of an alternate image for low resolution screen display.
- name - The assigned name of the image.
- prototype - Used for adding user-specified properties to the image.
- src - The URL of the image to be displayed. It is a read/write string.
- vspace - The read only vertical space above and below the image.
- width - The read only width of the image in pixels.
- links - An array of all the links in the document.
- link - A link in the document. Properties:
- hash - The URL anchor part including the leading hash mark if one exists.
- host - The URL hostname and port.
- hostname - The URL hostname section.
- href - The URL.
- pathname - The URL pathname section.
- port - The URL port section.
- protocol - The URL protocol section including the colon after the protocol name.
- search - The URL query string section. This is the section after and including the question mark.
- target - The URL link’s target name.
- parentWindow - The parent window of the document.
- plugins - An array of plugins in the document.
|
|