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