JavaScript Bible 4th Edition ISBN 0-7645-3342-8

Danny Goodman Appendix A

JavaScript and Browser Objects Quick Reference

©2001 Danny Goodman (www.dannyg.com). All Rights Reserved. 3

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. IE4+, NN6+ style Object Properties JSB4 IE4,N6 Operators 40 style 30

Comparison Text & Fonts Borders & Edges Inline Display & Layout == Equals color IE4, N6 borderIE4, N6 clear IE4, N6 N4, IE4 === Strictly equals fontIE4, N6 borderBottomIE4, N6 clip IE4, N6 != Does not equal fontFamily IE4, N6 borderLeftIE4, N6 clipBottom W5 N4, IE4 !== Strictly does not equal JavaScript and fontSize IE4, N6 borderRightIE4, N6 clipLeft W5 > Is greater than fontSizeAdjust M5, N6 borderTopIE4, N6 clipRight W5 >= Is greater than or equal to fontStretch M5, N6 borderBottomColor IE4, N6 clipTop W5 < Is less than Browser Objects fontStyle IE4, N6 borderLeftColorIE4, N6 content M5, N6 <= Is less than or equal to fontVariant IE4, N6 borderRightColorIE4, N6 counterIncrement M5, N6 fontWeight IE4, N6 borderTopColorIE4, N6 counterReset M5, N6 Arithmetic letterSpacing IE4, N6 borderBottomStyle IE4, N6 cssFloat M5, N6 + Plus (and string concat.) Quick Reference lineBreak IE5 borderLeftStyle IE4, N6 cursorIE4, N6 - Minus lineHeight IE4, N6 borderRightStyle IE4, N6 direction IE5, N6 * Multiply quotes M5, N6 borderTopStyle IE4, N6 display IE4, N6 / Divide rubyAlign IE5 borderBottomWidth IE4, N6 filterW4 % Modulo rubyOverhangIE5 borderLeftWidth IE4, N6 floatStyle M4 ++ Increment rubyPosition IE5 borderRightWidth IE4, N6 layoutGrid W5 -- Decrement textAlign IE4, N6 borderTopWidth IE4, N6 layoutGridChar W5 -val Negation textAlignLast IE5.5 borderColorIE4, N6 layoutGridLine W5 textAutospace W5 borderStyle IE4, N6 layoutGridMode W5 Assignment textDecoration IE4, N6 borderWidth IE4, N6 layoutGridType W5 = Equals Appendix A textDecorationBlink IE-Only marginIE4, N6 markerOffsetM5, N6 += Add by value textDecorationLineThrough IE-Only marginBottom IE4, N6 marks M5, N6 -= Subtract by value textDecorationNone IE-Only marginLeft IE4, N6 maxHeight M5, N6 *= Multiply by value textDecorationOverline IE-Only marginRight IE4, N6 maxWidth M5, N6 /= Divide by value JavaScript Bible, 4th Edition textDecorationUnderline IE-Only marginTopIE4, N6 minHeight M5, N6 %= Modulo by value textIndent IE4, N6 outline M5, N6 minWidth M5, N6 <<= Left shift by value by Danny Goodman textJustify IE5 outlineColor M5, N6 overflow IE4, N6 >>= Right shift by value textJustifyTrim IE5 outlineStyle M5, N6 overflowX W5 >>>= Zero fill by value textKashidaSpace IE5.5 outlineWidth M5, N6 overflowY W5 &= Bitwise AND by value textShadow M5, N6 padding IE4, N6 styleFloat IE-Only |= Bitwise OR by value textTransform IE4, N6 paddingBottom IE4, N6 verticalAlign IE4, N6 ^= Bitwise XOR by value textUnderlinePosition IE5.5 paddingLeft IE4, N6 visibility IE4, N6 unicodeBidi IE5, N6 paddingRight IE4, N6 widthIE4, N6 Boolean whiteSpace IE4, N6 paddingTop IE4, N6 zoom IE5.5 && AND wordBreakW5 || OR wordSpacing IE4, N6 Tables Printing ! NOT wordWrapIE5.5 borderCollapse M5, N6 orphansM5, N6 writingMode IE5.5 borderSpacing M5, N6 widows M5, N6 Bitwise captionSide M5, N6 pageM5, N6 & Bitwise AND How to Use This Quick Reference Positioning emptyCells M5, N6 pageBreakAfter IE4, N6 | Bitwise OR bottomIE5, N6 tableLayout IE5, N6 pageBreakBefore IE4, N6 ^ Bitwise XOR This guide contains quick reference info for the core JavaScript height IE4, N6 pageBreakInside M5, N6 ~ Bitwise NOT language, the original document object model (2 pp), the IE4+DHTML leftIE4, N6 Lists size N6 << Left shift object model (4 pp), and the W3C DOM object model(4 pp) as rightIE5, N6 listStyle IE4, N6 >> Right shift implemented in IE5+ and NN6. All-uppercase object names refer topIE4, N6 listStyleImage IE4, N6 Miscellaneous >>> Zero fill right shift IE4, N6 IE4, N6 W5 to HTML elements (IE4+ and W3C DOMs). The three columns width listStylePosition accelerator pixelBottom IE/W-Only listStyleType IE4, N6 behavior W5 Miscellaneous in each box list the object’s properties,methods, and event handlers pixelHeight IE-Only cssText IE4, N6 , Series delimiter in that order. Read the compatibility guides for each section. pixelLeft IE-Only Background imeMode W5 N4, IE4 delete Property destroyer pixelRight IE/W-Only background IE4, N6 inN6, IE5.5 Item in object Numbers in the upper right corners of object squares are chapter pixelTop IE-Only backgroundAttachment IE4, N6 Scrollbars instanceof N6,W5 Instance of numbers in which the object is covered in detail. pixelWidth IE-Only backgroundColor IE4, N6 scrollbar3dLightColor IE5.5 new Object creator posBottom IE/W-Only backgroundImage IE4, N6 scrollbarArrowColor IE5.5 this Object self-reference Basic browser and operating system notation codes are as follows: posHeight IE-Only gackgroundPosition IE4, N6 scrollbarBaseColor IE5.5 typeof N3, IE3 Value type IE-Only IE-Only IE5.5 N — Navigator IE — MS posLeft backgroundPositionX scrollbarDarkShadowColor void N3, IE3 Return no value posRight IE/W-Only backgroundPositionY IE-Only scrollbarFaceColor IE5.5 W — Win32 OS M — OS posTopIE-Only backgroundRepeat IE4, N6 scrollbarHighlightColor IE5.5 posWidth IE-Only scrollbarShadowColor IE5.5 See the accompanying file for printing and collating instructions position IE4, N6 scrollbarTrackColor IE5.5 in booklet or broadside configurations. zIndex IE4, N6 5

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. Page 2 of 2 — Original DOM (NN2+, IE3+) Quick Reference JSB4 form 23 select 26 action handleEvent( evt)N4 onReset N3, IE4 length blur()N3, IE4 onBlur elements[] reset()N3, IE4 onSubmit name focus()N3, IE4 onChange encoding submit() options[i] handleEvent( evt)N4 onFocus length options[i].defaultSelected method options[i].index name options[i].selected target options[i].text options[i].value selectedIndex N3, IE4 Original DOM button, reset, submit 24 type Compatibility Guide checked click() onClick N3 N4, IE4 Baseline browsers for this section are form handleEvent( evt) onMouseDown navigator 28 NN2, IE3/J1, and IE 3.01/Mac. An item with name onMouseUp N4, IE4 N3, IE4 N3, M4 no notation is compatible back to that level. type appCodeName javaEnabled() Notations indicate the browser and version value appMinorVersion IE4 preference(name[, val ])N4,(S) N3, M4 in which the property, method, or event handler appName taintEnabled() was introduced. An item showing to be introduced appVersion IE4 only in IE, for example, does not exist for any checkbox 24 browserLanguage NN version. cookieEnabled N6, IE4 IE4 checked click() onClick cpuClass Except for the window and navigator objects N3 N4, IE4 language N4 defaultChecked handleEvent( evt) onMouseDown (whose listings cover all browsers and N4, IE4 mimeTypes[] N3, M4 form onMouseUp versions), new features listed in this section onLine IE4 name cover only through NN4 (and IE4 when they N3, IE4 oscpu N6 type matched a new NN4 feature). Notations are platformN4, IE4 value as follows: plugins[] N3, M4 N3 — New in NN3 productN6 N4 — New in NN4 productSub N6 J2 — New in IE3, JScript.dll ver.2 radio 24 securityPolicy N6 IE4 — New in IE4, all OSes systemLanguage IE4 checked click() onClick (S) — Requires signed scripts (NN) userAgent defaultChecked handleEvent( evt)N3 onMouseDown N4, IE4 Additional window and navigator object userLanguage IE4 form onMouseUp N4, IE4 userProfile IE4 notations are: length vendorN6 W4 — IE4+/Windows only name vendorSub N6 W5 — IE5+/Windows only typeN3, IE4 IE5 — IE5+ all OSes value IE5.5 — IE5.5+ (only Win tested) mimeTypeN3,M4 28 pluginN3,M4 28 M4 — IE4+/Mac only M5 — IE5+/Mac only text, textarea, password, hidden 25 description (None) name refresh() N6 — New in NN6 enabledPlugin filename Except for items marked N4-Only (which are defaultValue (1) blur() onBlur type description not carried over into NN6), an item listed for form focus() onChange suffixes length an early browser is also available in the IE4+ name handleEvent( evt)N4 onFocus and/or W3C DOM object models. N3, IE4 N4, IE4 “(None)” means that no methods or events type select() onKeyDown N4,IE4 value (2) onKeyPress N4, IE4 screen 28 exist for the current object through IE3 and onKeyUp N4, IE4 NN4. availHeight (None) onSelect availLeft (1) (1) Not available for textarea object. availTop (1) (2) Password value property returns empty string in NN2. availWidth bufferDepth(2) colorDepth N3,(1),IE4 file input control 26 fontSmoothingEnabled (2) height form blur() onBlur pixelDepth name focus() onFocus updateInterval (2) N4 type handleEvent( evt) onSelect width value select() (1)N4+ only. (1) Netscape also calls this the fileUpload object. (2)IE4+ only. 7

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. Page 2 of 4 — IE4+ DHTML DOM Quick Reference JSB4 FORM 23 A (anchor/link) 21 IMG 22

action reset() onReset hash align (None) onAbort autocomplete W5 submit() onSubmit host alt onError elements[] hostname border onLoad encoding href complete enctype Methods dynsrc length mimeType fileCreatedDate method name fileModifiedDate name nameProp fileSize target pathname fileUpdatedDate port height protocol href LABEL 23 protocolLong hspace rel isMap htmlFor (None) (None) rev loop search lowsrc BUTTON 24 target name urn namePropW5 INPUT (button, reset, submit, radio, checkbox) protocol src (See original object model button, reset, submit, radio, and checkbox object listings.) start IE4+ DHTML DOM useMap vspace INPUT (image) 24 Compatibility Guide width

complete (None) (None) The baseline browser for this section is form MSIE 4. An item with no notation is AREA 22 name compatible back to that level for all src OS versions. Notations as follows: alt (None) (None) type W4 — IE4+/Windows only coords W5 — IE5+/Windows only hash IE5 — IE5+ all OSes host INPUT (text, password, hidden) 25 hostname IE5.5 — IE5.5+ (only Win tested) href (See original object model text, password, and hidden object listings.) M5 — IE5+/Mac noHref W4 maxLength (None) onAfterUpdate All HTML element objects share pathname W4 readOnly onBeforeUpdate items from “All HTML” box on Page 1. port W4 size onErrorUpdate “(None)” means no special methods or protocol events for the current object. search TEXTAREA 25 shape target (See original object model textarea object listing.) cols createTextRange() onAfterUpdate W4 OL 27 readOnly onBeforeUpdate W4 MAP 22 compact rows onErrorUpdateW4 wrap start areas[] (None) onScroll type name SELECT 26 UL 27 (See original object model select object listing.) 19 length options[i].add( elem[,index ]) (None) compact MARQUEE type multiple options[i].remove() behavior start() onBounce size bgColor stop() onFinish value LI 27 direction onStart height OPTION 26 type hspace value loop defaultSelected (None) (None) scrollAmount form scrollDelay selected DL, DT, DD, DIR, MENU trueSpeed text vspace value compact width 9

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. Page 4 of 4 — IE4+ DHTML DOM Quick Reference JSB4 STYLE 30 event 29 APPLET 32

media (None) (None) altKey align (None) onCellChange W5 type altLeft IE5.5 altHTML onDataAvailable W5 behaviorCookie W5.5 code onDatasetChanged W5 behaviorPart W5.5 codeBase onDatasetComplete W5 styleSheet 30 bookmarks W4 height onLoad boundElements hspace onRowEnterW5 cssText IE5 addImport("URL"[,index ]) (None) button name onRowExit W5 disabled addRule("selector ","styleSpec "[,index ]) cancelBubble vspace onRowsDelete W5 href removeRule( index ) clientX width onRowsInserted W5 id clientY onScroll imports[] contentOverflow media ctrlKey owningElement ctrlLeft IE5.5 OBJECT 32 pages[] IE5.5 dataFldW4 parentStyleSheet dataTransferW5 align (None) onCellChange W5 readOnly fromElement altHTML onDataAvailable W5 rules[] keyCode BaseHref onDatasetChanged W5 title nextPage W5.5 classid onDatasetComplete W5 type offsetX code onLoad offsetY codeBase onRowEnterW5 W5 codeType onRowExit W5 IE5 IE5.5 propertyName currentStyle , runtimeStyle 30 qualifier W4 height onRowsDelete W5 reasonW4 hspace onRowsInserted W5 (See style object) recordset W4 name onScroll repeatW5 object returnValue type rule 30 saveType W5.5 vspace screenX width readOnly (None) (None) screenY selectorText shiftKey EMBED 32 style shiftLeft IE5.5 srcElement align (None) onLoad W4 srcFilter height onScroll W5 srcUrn hidden toElement name type pluginspage x src y units width LINK 20 W5 disabled (None) onLoad XML 32 href hreflang src (None) (None) media XMLDocument rel rev styleSheet target type

SCRIPT 20

defer (None) (None) event htmlFor language src text type 11

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. Page 2 of 4 — W3C DOM (IE5+, NN6+) DOM Quick Reference JSB4 FORM 23 SELECT 26 A (anchor/link) 21

acceptCharset (1) reset() onReset (See original object model select object listing.) charset (1) action submit() onSubmit disabled item(i) (None) coords (1) elements[] length namedItem("optionID ") hash encoding multiple options[ i].remove() host enctype size hostname length value href method hreflang(1) name name target OPTION 26 pathname port defaultSelected (None) (None) (1)Not implemented in IE through 5.5. protocol disabled rel form rev 23 label (1) FIELDSET, LEGEND search selected shape (1) align (None) (None) text target form value type(1) (1)Not implemented in IE/Windows through 5.5, but is implemented in IE5/Mac. (1)Not implemented in IE through 5.5. LABEL 23 OPTGROUP 26 accessKey (None) (None) AREA 22 form(1) form(1) (None) (None) (1) htmlFor label alt (1)Not implemented in IE through 5.5. (1)Not implemented in IE/Windows through 5.5, but is implemented in IE5/Mac. coords hash host hostname BUTTON 24 href IMG 22 noHref INPUT (button, reset, submit, radio, checkbox) pathname align (None) onAbort port (See original object model button, reset, submit, radio, and checkbox object listings.) alt onError protocol disabled border onLoad search complete shape height target INPUT (image) 24 href hspace disabled (None) (None) isMap MAP 22 form longDesc (1) lowsrc name areas lowSrc (1) src name type name src useMap INPUT (text, password, hidden) 25 vspace width (See original object model text, password, and hidden object listings.) (1)Not implemented in IE through 5.5. disabled (None) (None) maxLength readOnly size OL 27 UL 27

compact compact TEXTAREA 25 start type type (See original object model textarea object listing.) cols (None) (None) LI 27 disabled DL, DT, DD, DIR, MENU readOnly type rows compact value 13

© 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. Page 4 of 4 — W3C DOM (IE5+, NN6+) DOM Quick Reference JSB4 STYLE 30 event (1) 29

media (None) (None) altKey initEvent(" type",bubble ,cancelable ) (None) type bubbles initKeyEvent(" type", evtArgs ) button initMouseEvent(" type", evtArgs ) cancelBubble initUIEvent(" type", evtArgs ) styleSheet 30 cancelable preventDefault() charCode stopPropagation() cssRules[] deleteRule( index )(1) (None) clientX disabled insertRule("rule",index )(1) clientY href ctrlKey media currentTarget ownerNode(1) detail ownerRule(1) eventPhase parentStyleSheet isChar title keyCode type layerX layerY (1)Not implemented in IE through 5.5. metaKey pageX pageY cssRule 30 relatedTarget screenX cssText (2) (None) (None) (2) screenY parentStyleSheet shiftKey selectorText W3C DOM target style (1) Compatibility Guide timeStamp type type (1)Not implemented in IE through 5.5. Baseline browsers for this section are view IE5 and NN6. An item with no notation (2)Not implemented in IE through 5.5, but implemented in IE5/Mac. (1)Not implemented in IE through 5.5. is compatible with these browsers for all OS versions. Observe footnotes for items missing from IE. All HTML element objects share items from “All HTML” box on Page 1. “(None)” means no special methods or events for the current object. EMBED 32 LINK 20 align (None) onLoad charset (1) (None) (None) height onScroll disabled name href src hreflang width media rel rev APPLET 32 OBJECT 32 target type align align alt(1) alt(1) (1)Not implemented in IE through 5.5. archive (1) code code codeBase codeBase codeType SCRIPT 20 height contentDocument hspace height name hspace defer (None) (None) (1) event object name htmlFor vspace object language width type src (1)Not implemented in IE through 5.5. vspace text width type (1)Not implemented in IE through 5.5. 2

Core JavaScript/JScript/ECMAScript (NN2+, IE3+) Quick Reference © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 Array N3,J2 37 String 34 Math(1) 35 Control Statements 39

constructor N4, IE4 concat( array2)N4, IE4 constructor N4, IE4 anchor("anchorName ") E abs(val ) if (condition ) { length join("char") length big() LN2 acos(val ) statementsIfTrue prototype push()N4, IE5.5 prototype N4, J2 blink() LN10 asin(val ) } pop()N4, IE5.5 bold() LOG2E atan(val ) reverse() charAt(index ) LOG10E atan2(val1 , val2 ) if (condition ) { shift()N4, IE5.5 charCodeAt([i])N4, IE4 PI ceil( val ) statementsIfTrue slice(i,[j]) N4, IE4 concat( string2 )N4, IE4 SQRT1_2 cos(val ) } else { sort(compareFunc ) fixed() SQRT2 exp(val ) statementsIfFalse splice(i,j[, items ])N4, IE5.5 fontcolor(# rrggbb) floor(val ) } toLocaleString() N6, IE5.5 fontsize(1to7) log(val ) toString() fromCharCode(n1...)(1),N4, IE4 max(val1 , val2 ) result = condition ? expr1 : expr2 unshift()N4, IE5.5 indexOf("str" [,i]) min(val1 , val2 ) italics() pow(val1 , power) for ([init expr ]; [condition ]; [update expr]) { Date 36 lastIndexOf("str" [,i]) random() statements link( URL) round(val ) } constructor N4, IE4 getFullYear()N4, J2 localeCompare() N6, IE5.5 sin(val ) prototype N3, IE4 getYear() match(regexp)N4, IE4 sqrt(val ) for (var in object ) { with (object ) { getMonth() replace(regexp,str)N4, IE4 tan(val ) statements statements N4, IE4 } } getDate() search(regexp) (1)All properties & methods are of the static Math object. getDay() slice( i,j)N4, IE4 getHours() small() while (condition ) { do { getMinutes() split( char)N3, (2), IE4 Number N3,J2 35 statements statements getSeconds() strike() } } while (condition )N4, IE4 getTime() sub() constructor N4, IE4 toExponential( n)N6, IE5.5 N4, J2 N4, IE4 switch ( expression ) { getMilliseconds() substr(start,length ) MAX_VALUE toFixed(n)N6, IE5.5 N4, J2 case labelN : getUTCFullYear() substring( intA , intB ) MIN_VALUE toLocaleString() N6, IE5.5 N4, J2 statements getUTCMonth() sup() NaN toString([radix])N4, IE4 N4, J2 N6, IE5.5 [break] getUTCDate() toLocaleLowerCase() NEGATIVE_INFINITY toPrecision( n)N6, IE5.5 N4, J2 N6, IE5.5 ... getUTCDay() toLocaleUpperCase() POSITIVE_INFINITY valueOf()N4, IE4 N4, J2 [default : getUTCHours() toLowerCase() prototype getUTCMinutes()N4, J2 toString()N4, IE4 statements ] N4, IE4 getUTCSeconds() N4, J2 toUpperCase() } getUTCMilliseconds() N4, J2 valueOf()N4, IE4 N3,J2 41 setYear(val ) Function label : N4, IE4 (1)Method of the static String object. N4, IE4 setFullYear( val )N4, J2 (2)Added behavior in N4 includes: ability to accept a regexp N6, IE5.5 continue [ label ] arguments apply( this , argsArray) N4, IE4 setMonth(val ) parameter; second parameter (limit integer) to limit the number of N4 N6, IE5.5 break [label ] splits to be included; a space string parameter signifying any white arity call( this [,arg1[,...argN]]) setDate(val ) space character. caller (1) toString() try { setDay(val ) constructor N4, IE4 valueOf() statements to test setHours(val ) length } setMinutes( val ) N4,IE4 prototype setSeconds( val ) Regular Expressions 38 [catch ( errorInfo) { setMilliseconds( val )N4, J2 (1)Discontinued for N6. statements if exception occurs in try block global compile( ) setTime(val ) regexp }] ignoreCase exec(" ")(2) setUTCFullYear(val )N4, J2 string [finally { input (1), IE5.5 test(" ") setUTCMonth(val )N4, J2 string Globals 42 statements to run, exception or not lastIndex .match( ) N6, W5 setUTCDate(val )N4, J2 str regexp }] multiline (1), IE5.5 .replace( , ) setUTCDay(val )N4, J2 str regexp str Functions lastMatch (1), IE5.5 .search( ) N6, IE5.5 N6, W5 setUTCHours(val )N4, J2 str regexp decodeURI("encodedURI ") throw value lastParen (1), IE5.5 .split( [, ]) N6, IE5.5 setUTCMinutes( val )N4, J2 str regexp limit decodeURIComponent(" encComp ") leftContext (1), IE5.5 N6, IE5.5 setUTCSeconds( val )N4, J2 encodeURI("URIString") N4, J2 prototype encodeURIComponent(" compString ")N6, IE5.5 setUTCMilliseconds( val ) (1) getTimezoneOffset() rightContext escape("string" [,1]) toDateString()IE5.5 source eval("string") N6,W5 39 N4, IE4 Error toGMTString() $1...$9 isFinite( number) toLocaleDateString() IE5.5, N6 (1)Property of the static RegExp object. isNaN(expression ) prototype toString() N4, IE4 toLocaleString() (2)Returns an array with properties: index, input, [0], [1],...[n]. Number(string) constructor toLocaleTimeString() IE5.5, N6 parseFloat("string") description W5 parseInt("string" [,radix]) Statements fileName N6 toString() N3,J2 toTimeString()IE5.5 Boolean 35 toString([radix]) // /*...*/ lineNumber N6 N6 toUTCString()N4, J2 unescape("string") const message N6, IE5.5 N4 Date.parse("dateString ") constructor N4, IE4 toString()N4, IE4 unwatch(prop) var nameN6, IE5.5 N4 Date.UTC(date values ) prototype valueOf()N4, IE4 watch(prop, handler) numberW5 4

Original DOM (NN2+, IE3+) Quick Reference — Page 1 of 2 © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 window 16 document 18 link ( ) 21

_content N6 alert("msg") onAbortN6 alinkColor captureEvents( type)N4-Only (None) hash (None) onClick appCoreN6 attachEvent(" evt",func)IE5 onAfterPrint W5 anchors[] clear() host onDblClick N4,(1),IE4 clientInformation IE4 back()N4 onBeforePrint W5 applets[] N3, IE4 close() hostname onMouseDown N4, IE4 clipboardData W5 blur()N3, IE4 onBeforeUnload IE4 bgColor getSelection() N4,(2) href onMouseOut N4, IE4 closed N3, IE4 captureEvents(type) N4-Only onBlurN3, IE4 cookie handleEvent( event)N4-Only pathname onMouseOver Components[] N6 clearInterval(ID) N4, IE4 onChangeN6 domain N3, IE4 open("mimetype " [,replace ])(3) port onMouseUp N4, IE4 controllers[] N6 clearTimeout(ID) onClick N6 embeds[] N3, IE4 releaseEvents( type)N4-Only protocol crypto N6 close() onClose N6 fgColor routeEvent(event)N4-Only search defaultStatus confirm("msg") onDragDropN4,(S) forms[] write("string") target dialogArguments W4 createPopup()IE5.5 onErrorN3, IE4 height N4 writeln("string") textN4 dialogHeight W4 detachEvent(" evt",func)IE5 onFocus N3, IE4 images[] N3, IE4 xN4 dialogLeft W4 disableExternalCapture() N4-Only onHelp IE4 lastModified yN4 dialogTop W4 enableExternalCapture() N4-Only onKeyDown N6 layers[] N4-Only (1) Not implemented in NN4/Mac dialogWidth W4 execScript(" exprs"[,lang])IE4 onKeyPress N6 linkColor directories N4,(S) find(["str"][,case , bkwd])N4-Only onKeyUp N6 links[] document fireEvent("evt"[,evtObj])IE5.5 onLoad location (1) anchor ( ) 21 event IE4 focus()N3, IE4 onMouseDown N6 referrer external W4 forward() N4 onMouseMove N6 title nameN4, IE4 (None) (None) frameElement IE5.5 handleEvent( event)N4-Only onMouseOut N6 URLN3, IE4 textN4 frames[] home()N4 onMouseOver N6 vlinkColor xN4 history moveBy(Dx,Dy)N4, IE4 onMouseUp N6 widthN4 yN4 N4 N4, IE4 N4-Only innerHeight moveTo(x,y) onMove (1) Replaced by the URL property in Navigator 3. innerWidth N4 navigate() IE3 onReset N6 (2) M4 has a document.selection property to retrieve the currently selected text. length N6, IE4 open(URL,"name","specs ")(1),(S) onResize N4, IE4 (3) mimetype parameter new in M4, but only "text/" type supported. N3,(1),IE4 22 loading N4-Only print()N4, IE5 onScroll IE4 image N6 location prompt("msg","reply") onSelect N4-Only border (None) onAbort N4,(S) N4-Only N6 layer 31 locationbar releaseEvents( type) onSubmit complete onError N4,(S) N4, IE4 menubar resizeBy(Dx,Dy) onUnload height onLoad N4, IE4 above load("filename ", y) onBlur name resizeTo(width,height ) hspace N6, IE4 N4-Only background moveAbove( layerObj ) onFocus navigator routeEvent(event) lowsrc W4 N3, IE4 below moveBelow( layerObj ) onLoad offscreenBuffering scroll( x,y) name IE3, N3 N4, IE4 bgColor moveBy(Dx, Dy) onMouseOut opener scrollBy(D x,Dy) src N4 N4, IE4 clip.bottom moveTo(x, y) onMouseOver outerHeight scrollTo( x,y) vspace N4 IE5.5 clip.height moveToAbsolute( x, y) onMouseUp outerWidth setActive() width N4 N4,IE4,(2) clip.left resizeBy(Dx, Dy) pageXOffset setInterval( func, msec [,args]) xN4 N4 (2) clip.right resizeTo(width, height ) pageYOffset setTimeout( func, msec [,args]) yN4 W4 clip.top parent showHelp() clip.width N4,(S) W4 (1) Implemented in IE3.01/Macintosh but not Windows until IE4. personalbar showModalDialog() document pkcs11 N6 showModelessDialog() W5 N6 N4 left prompter stop() name N3,IE4 22 returnValue W4 area N6, IE4 pageX screen hash N4 W5 pageY (None) onClick screenLeft host W5 parentLayer onMouseOut screenTop hostname N6 siblingAbove onMouseOver screenX href N6 siblingBelow screenY pathname N4,(S) src scrollbars port N6 top scrollX protocol N6 visibility scrollY zIndex search self target sidebar N4,(S) status 17 N4,(S) location statusbar 17 toolbar N4,(S) hash assign(" URL") (None) history top host reload([unconditional ])N3,IE4 length back() (None) window hostname replace("URL")N3,IE4 current(S),(1) forward() href (1)New window specs for all browsers: height, width, toolbar, location, directories, status, menubar, next(S),(1) go(int | "URL") scrollbars, resizable, copyhistory. Add'l specs for N4+: alwaysLowered(S), alwaysRaised(S), pathname dependent, hotkeys, innerHeight, innerWidth, outerHeight, outerWidth, screenX, screenY, titlebar(S), previous (S),(1) z-lock(S). Add'l specs for IE4+: channelmode, fullscreen, left, top. Add'l spec for IE5+: title. port (2)Optional args parameter added to N4; 3rd parameter in IE4 is for scripting language. protocol (1) Accessible in NN3 via a security technique no longer in use. Available in NN4+ with signed scripts. 6

IE4+ DHTML DOM Quick Reference — Page 1 of 4 © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 All HTML Elements 15 FRAMESET 16 document 18 accessKey addBehavior("URL") W5 onActivate IE5.5 border activeElement attachEvent(" evt",func)IE5 onActivate IE5.5 all[] applyElement( elem[,type])W5 onBeforeCopy W5 borderColor alinkColor clear() onBeforeCutW5 behaviorUrns[] W5 attachEvent(" evt",func)W5 onBeforeCutW5 cols all clearAttributes() IE5 onBeforeDeactivate IE5.5 canHaveChildren W5 blur() onBeforeDeactivate IE5.5 frameBorder anchors[] close() onBeforeEditFocus W5 canHaveHTML IE5.5 clearAttributes() W5 onBeforeEditFocus W5 frameSpacing applets[] createElement(" tag") onBeforePaste W5 children click() onBeforePaste W5 rows bgColor createEventObject([ evt])IE5.5 onClick className componentFromPoint( x,y)W5 onBlur body createStyleSheet([" URL"[,index ]]) onContextMenu W5 clientHeight contains( elem) onClick charset detachEvent(" evt",func)IE5 onControlSelect IE5.5 clientLeft detachEvent(" evt",func) W5 onContextMenu W5 FRAME 16 cookie elementFromPoint( x,y) onCut clientTop fireEvent("evt"[,evt])IE5.5 onControlSelect IE5.5 defaultCharset execCommand(" cmd"[,UI][,arg]) onDblClick clientWidth focus() onCopy W5 borderColor designMode W5 focus() onDeactivate IE5.5 contentEditable IE5.5 getAdjacentText() W5 onCutW5 Document doctype mergeAttributes( obj)W5 onDragW5 currentStyle IE5 getAttribute("attr"[,case ]) onDblClick frameBorder domain open(["mimeType "[,replace ]) onDragEndW5 dataFld W4 getBoundingClientRect() W5 onDeactivate IE5.5 height embeds[] queryCommandEnabled(" cmd") onDragEnterW5 dataFormatAs W4 getClientRects() W5 onDragW5 marginHeight expando queryCommandIndterm("cmd") onDragLeave W5 dataSrc W4 getExpression() W5 onDragEndW5 marginWidth fgColor queryCommandState(" cmd") onDragOverW5 disabled insertAdjacentElement() W5 onDragEnterW5 noResize fileCreatedDate queryCommandSupported(" cmd") onDragStartW5 document insertAdjacentHTML() onDragLeave W5 scrolling fileModifiedDate queryCommandText("cmd") onDropW5 filters[] W4 insertAdjacentText() onDragOverW5 src fileSize queryCommandValue(" cmd") onHelp W4,M5 hideFocus IE5.5 item(index [,subindex ])(1) onDragStartW5 width forms[] recalc( allFlag )W5 onKeyDown id mergeAttributes() W5 onDropW5 frames[] releaseCapture() IE5 onKeyPress IE5.5 innerHTML releaseCapture()W5 onFilterChange W4 16 images[] setActive() onKeyUp innerText removeAttribute("attr"[,case ]) onFocus IFRAME lastModified write("str") onMouseDown IE5.5 W5 W4,M5 isContentEditable removeBehavior( ID) onHelp align linkColor writeln("str") onMouseMove IE5.5 W5 isDisabled removeExpression(" prop") onKeyDown Document links[] onMouseOut IE5.5 W5 isMultiLine removeNode(children ) onKeyPress frameBorder location onMouseOver W4 W5 IE5.5 isTextEdit replaceAdjacentText(" loc ","txt") onKeyUp frameSpacing media onMouseUp lang replaceNode( new)W5 onLoseCapture W5 mimeType W5 onPaste hspace IE5.5 W5 language scrollIntoView( top) onMouseDown marginHeight namespaces[] onPropertyChange (1) IE5.5 IE5.5 length setActive() onMouseEnter marginWidth parentWindow onReadyStateChange IE5.5 IE5.5 offsetHeight setAttribute("attr",val [,case ]) onMouseLeave scrolling plugins[] onResizeEnd W5 IE5.5 offsetLeft setCapture(container ) onMouseMove src protocol onResizeStart W5 offsetParent setExpression(" prop","expr","lang") onMouseOut vspace readyState onSelectionChange offsetTop swapNode(node)W5 onMouseOver referrer onStop IE5 offsetWidth tags("tag") (1) onMouseUp scripts[] outerHTML urns("URN")W5,(1) onPaste W5 security IE5.5 outerText onPropertyChange W5 selection parentElement W4 onReadyStateChange styleSheets[] parentTextEdit onResize BASE 20 title readyState onResizeEnd IE5.5 uniqueID recordNumberW4 onResizeStart IE5.5 href URL runtimeStyle W5 onSelectStart target URLUnencoded IE5.5 scopeName W5 vlinkColor scrollHeight scrollLeft BASEFONT 20 scrollTop BODY 18 scrollWidth color W5 W5 sourceIndex face alink createControlRange() onAfterPrint W5 style size background createTextRange() onBeforePrint W5 tabIndex bgColor doScroll([" scrollAction "]) onScroll bgProperties tagName 20 tagUrnW5 META bottomMargin title charset leftMargin uniqueID W5 content link httpEquiv noWrap (1)Property or method of all object collections. name rightMargin url scroll scrollLeft popupW5.5 16 scrollTop TITLE 20 text document hide() (None) topMargin isOpen show() text vLink 8

IE4+ DHTML DOM Quick Reference — Page 3 of 4 © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 TABLE 27 H1...H6 19 TextRangeW4 19

align createCaption() onScroll align boundingHeight collapse([ start]) (None) background createTFoot() boundingLeft compareEndPoints(" type",range) bgColor createTHead() boundingTop duplicate() border deleteCaption() HR 19 boundingWidth execCommand(" cmd"[,UI[,val ]]) borderColor deleteRow(i) htmlText expand("unit") borderColorDark deleteTFoot() align offsetLeft findText("str"[,scope ,flags ]) borderColorLight deleteTHead() color offsetTop getBookmark() caption firstPage()W5 noShade text getBoundingClientRect() cellPadding insertRow(i) size getClientRects() cellSpacing lastPage() W5 width inRange(range) cells[] moveRow(srcIndex ,destIndex )W5 isEqual( range) cols[] nextPage()W4 BR 19 move("unit"[,count]) datePageSize previousPage() W4 moveEnd("unit"[,count]) frame refresh() clear moveStart("unit"[,count]) height moveToBookmark(" bookmark ") rows[] moveToElementText( elem) rules FONT 19 moveToPoint( x,y) tBodies[] parentElement() tFoot color pasteHTML("HTMLText") tHead face queryCommandEnabled(" cmd") width size queryCommandIndeterm("cmd") queryCommandState(" cmd") queryCommandSupported(" cmd") TBODY, TFOOT, THEAD 27 queryCommandText("cmd") queryCommandValue(" cmd") align deleteRow(i) (None) scrollIntoView() bgColor insertRow(i) select() rows moveRow(srcIndex ,destIndex ) setEndPoint(" type",range) vAlign IE4+ DHTML DOM IE5 Compatibility Guide TextNode 19 TR 27 The baseline browser for this section is data splitText( offset) (None) align deleteCell( i) (None) MSIE 4. An item with no notation is length bgColor insertCell( i) compatible back to that level for all nextSibling nodeName borderColor OS versions. Notations as follows: borderColorDark nodeType borderColorLight W4 — IE4+/Windows only nodeValue cells[] W5 — IE5+/Windows only parentNode height IE5 — IE5+ all OSes previousSibling rowIndex IE5.5 — IE5.5+ (only Win tested) sectionRowIndex M5 — IE5+/Mac M4 vAlign All HTML element objects share selection 19 items from “All HTML” box on Page 1. “(None)” means no special methods or type clear() (None) TD, TH 27 COL, COLGROUP 27 events for the current object. createRange() empty() align align This Quick Reference does not contain background span listings for Microsoft’s separate XML bgColor vAlign DOM. TextRectangleIE5 19 borderColor width borderColorDark bottom (None) (None) borderColorLight left cellIndex right colSpan top height noWrap CAPTION 27 rowSpan vAlign align width vAlign 10

W3C DOM (IE5+, NN6+) Quick Reference — Page 1 of 4 © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 All HTML Elements 15 HEAD 20 document 18

attributes[] addEventListener(" evt",func,capt)(2) onBlur profile (1) alinkColor clear() onBlur childNodes[] appendChild( elem) onClick anchors[] onClick (1)Not implemented in IE through 5.5. close() className blur() onDblClick applets[] createAttribute("name") onDblClick dir click() onFocus attributes[] createDocumentFragment() onFocus firstChild cloneNode( deep) onKeyDown 20 bgColor createElement(" tag") onKeyDown id dispatchEvent( evt)(2) onKeyPress BASE body createTextNode("txt") onKeyPress innerHTML(1) focus() onKeyUp characterSet (1) onKeyUp href focus() lang getAttribute("attr") onMouseDown childNodes[] onMouseDown target getElementById(" ID") lastChild getAttributeNode("attr")(2) onMouseMove cookie getElementsByName(" name") onMouseMove length (3) getElementsByTagName(" tag") onMouseOut doctype (1) getElementsByTagName(" tag") onMouseOut localName hasChildNodes() onMouseOver documentElement open("mimeType "[,replace ]) onMouseOver namespaceURI insertBefore( new[,ref]) onMouseUp BASEFONT 20 domain write("str") onMouseUp nextSibling item(index )(3) onResize embeds[] writeln("str") onResize nodeName normalize() (2) color fgColor nodeType removeAttribute("attr") face firstChild nodeValue removeAttributeNode( node)(2) size forms[] offsetHeight (1) removeChild( node) height (1) offsetLeft (1) removeEventListener(" evt",func,capt)(2) images[] offsetParent (1) replaceChild( new,old) META 20 implementation (1) offsetTop (1) setAttribute("attr",val ) lastChild offsetWidth (1) setAttributeNode( node)(2) charset lastModified ownerDocument supports("feature")(2) content linkColor parentNode httpEquiv links[] prefix name location previousSibling url namespaceURI style nextSibling tabIndex nodeName tagName TITLE 20 nodeType title ownerDocument (1) text (1)Originating from the IE4 Object Model, this non-W3C item is implemented in N6 for convenience. parentNode (2)Not implemented in IE through 5.5. plugins (3)Property or method of all object collections. previousSibling referrer W3C DOM styleSheets[] HTML 20 title Compatibility Guide URL version (1) (None) (None) Baseline browsers for this section are vlinkColor width(1) (1)Not implemented in IE through 5.5. IE5 and NN6. An item with no notation is compatible with these browsers for (1)Not implemented in IE through 5.5. all OS versions. Observe footnotes for items missing from IE. All HTML element objects share BODY 18 items from “All HTML” box on Page 1. “(None)” means no special methods or alink (None) (None) FRAMESET 16 events for the current object. background bgColor cols (None) (None) link rows text vLink FRAME 16 IFRAME 16

contentDocument (1) (None) (None) align frameBorder contentDocument (1) longDesc (1) frameBorder marginHeight longDesc (1) marginWidth marginHeight noResize marginWidth scrolling scrolling src src (1)Not implemented in IE through 5.5. (1)Not implemented in IE through 5.5. 12

W3C DOM (IE5+, NN6+) Quick Reference — Page 3 of 4 © 2001 Danny Goodman (www.dannyg.com). All Rights Reserved. JSB4 TABLE 27 H1...H6 19 Range(1) 19

align createCaption() onScroll align collapsed cloneContents() (2) (None)(None) bgColor createTFoot() commonAncestorContainer cloneRange() border createTHead() endContainer collapse([ start]) caption deleteCaption() endOffset compareBoundaryPoints( type,src)(3) cellPadding deleteRow(i) HR 19 startContainer createContextualFragment(" text") cellSpacing deleteTFoot() align startOffet deleteContents() frame deleteTHead() color detach() height insertRow(i) extractContents() (2) noShade (2) rows[] size insertNode(node) rules width isValidFragment(" txt") summary (1) selectNode( node) tBodies selectNodeContents( node) tFoot 19 setEnd(node,offset) tHead BR setEndAfter( node) width clear setEndBefore( node) setStart(node,offset) (1)Not implemented in IE through 5.5. setStartAfter(node) 19 setStartBefore( node) FONT surroundContents( node)(2) TBODY, TFOOT, THEAD 27 color toString() align deleteRow(i) (None) face (1)Not implemented in IE through 5.5. bgColor insertRow(i) size (2)Not implemented in NN6.0 ch(1) (3)Broken in NN6.0 chOff(1) rows BLOCKQUOTE, Q 19 vAlign Text (1) 19 cite (1) (1)Not implemented in IE through 5.5. (1)Not implemented in IE through 5.5. data appendChild( node) (None) length appendData("text") cloneNode( deep) TR 27 deleteData(offset,count) hasChildNodes() align deleteCell( i) (None) insertBefore( new,ref) bgColor insertCell( i) insertData(offset,"text") cells[] normalize() ch(1) removeChild() chOff(1) replaceChild( offset,count,"text") rowIndex splitText( offset) vAlign substringData( offset,count) (1)Not implemented in IE through 5.5. (1)Not implemented in IE through 5.5.

27 27 TD, TH COL, COLGROUP selection(1),(2) 19 abbr(1) align align ch(1) anchorNode addRange(range) (None) axis (1) chOff(1) anchorOffset clearSelection() background span focusNode collapse( node,offset) bgColor vAlign Node Types focusOffset containsNode( node,recurse) cellIndex width ELEMENT_NODE 1 isCollapsed deleteFromDocument() ch(1) ATTRIBUTE_NODE 2 rangeCount extend(node,offset) chOff(1) (1)Not implemented in IE through 5.5. TEXT_NODE 3 getRangeAt() colSpan CDATA_SECTION_NODE 4 removeRange(range) (1) headers ENTITY_REFERENCE_NODE 5 (1)NN6.0 does not provide a way to create a selection object. height ENTITY_NODE 6 (2)Not implemented in IE through 5.5. noWrap PROCESSING_INSTRUCTION_NODE 7 rowSpan 27 COMMENT_NODE 8 vAlign CAPTION DOCUMENT_NODE 9 width align DOCUMENT_TYPE_NODE 10 DOCUMENT_FRAGMENT_NODE 11 (1)Not implemented in IE through 5.5. vAlign NOTATION_NODE 12 window frame self top parent

navigator screen history document location event link styleSheets applets form images plugins embeds all anchor [elements] text radio button select selection style textarea checkbox reset option

password submit