11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

eadyState Read-only string containing the current state of the object. Values include<br />

"uninitialized", "loading", "loaded", "interactive" (not finished loading but able to respond<br />

to user actions), and "complete". Objects progress through each of these states until<br />

they have completed loading, though some objects may skip some intermediate steps<br />

(for example, pass from "uninitialized" directly to "complete"). This property is very<br />

useful in determining whether an element has completed loading. However, you should<br />

always make sure the object exists in the Document before attempting to read this<br />

property (otherwise, a runtime error will be thrown because you would be attempting to<br />

read a property of an object not yet defined). Note that an s readyState is<br />

given by the integers 0 through 4 (with the same meaning). (IE4+)<br />

recordNumber Read-only numeric value indicating the record number of the data set<br />

from which the element was generated. (IE4+)<br />

runtimeStyle <strong>Reference</strong> to the Style object that reflects the current (runtime) style<br />

characteristics of the element. (IE5+)<br />

scopeName Read-only string containing the XML scope for the object. (IE5+)<br />

scrollHeight Numeric read-only value indicating the total height in pixels of the<br />

element‘s content area, no matter how much is displayed on screen. (IE4+)<br />

scrollLeft Numeric value indicating the distance in pixels from the left edge of the<br />

object to the leftmost edge of the object that is currently displayed. (IE4+)<br />

scrollTop Numeric value indicating the distance in pixels from the top edge of the<br />

object to the topmost edge that is currently displayed. (IE4+)<br />

scrollWidth Numeric read-only value indicating the total width in pixels of the object‘s<br />

content area, no matter how much is displayed on screen. (IE4+)<br />

sourceIndex Read-only number indicating the index of the element in the<br />

document.all[] collection. (IE4+)<br />

style <strong>Reference</strong> to the inline Style object for the element. (IE4+, N4+, DOM2)<br />

syncMaster Specifies whether time container must synchronize with the element. See<br />

MSDN. (IE5.5+, SMIL)<br />

tabIndex Numeric value indicating the tab order for the object. Elements with positive<br />

values for this property are tabbed to in order of increasing tabIndex (before any<br />

others). Elements with zero for this property (the default) are tabbed to in the order they<br />

occur in the document source. Elements with negative values are not tabbed to at all.<br />

(IE4+)<br />

tagName String containing the name of the tag to which the object corresponds, for<br />

example, "H1." (IE5.5+, MOZ/N6+, DOM1)<br />

tagUrn String containing the URN of the XML Namespace for the object. (IE5+)<br />

timeContainer Sets or retrieves the type of timeline associated with the element.<br />

(IE5.5+, SMIL)<br />

title String containing advisory text for the element. (IE4+, MOZ/N6+, DOM1)<br />

uniqueID An auto-generated read-only unique id for this element. (IE5+)<br />

Methods<br />

addBehavior(url) Attaches the DHTML Behavior referenced by string url to the<br />

element. (IE5+)<br />

addEventListener(whichEvent, handler, direction) Instructs the object to execute<br />

the function handler whenever an event of type given in the string whichEvent (for<br />

example, "click") occurs. <strong>The</strong> direction is a Boolean specifying the phase in which to<br />

fire, true for capture or false for bubbling. (MOZ/N6+, DOM2)<br />

appendChild(newChild) Appends newChild to end of the node‘s childNodes[] list.<br />

(IE5+, MOZ/N6+, DOM1 Core)<br />

applyElement(newElement [, where]) ―Applies‖ one element to another by enclosing<br />

one within the other. If where is omitted or has value "outside", the object referenced by<br />

newElement becomes the parent of the current element. Otherwise, newElement<br />

becomes the only child of the current element, enclosing all of the current element‘s<br />

children. (IE5+)<br />

attachEvent(whichHandler, theFunction) Attaches the function theFunction as a<br />

handler specified by the string whichHandler, for example, "onclick". (IE5+)<br />

blur() Removes focus from the element. (IE5+ for most elements. For form fields N2+<br />

or N3+ and IE3+ or IE4+ and DOM1, listed specifically for each object)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!