JavaScript Reference examples (example source code) Organized by topic





Javascript Objects /

Array 4attribute 6Boolean 3clientInformation 7
clipboardData 4currentStyle 6dataTransfer 5Date 4
defaults 5Dialog Helper 4document 8event 6
external 4history 5implementation 4location 5
Math 4mimeType 4namespace 6navigator 7
Number 4Object 4page 4plugin 4
popup 5rule 5runtimeStyle 7screen 4
selection 5String 4style 7styleSheet 6
TextNode 4TextRange 4TextRectangle 3userProfile 4
window 7

Javascript Properties /

abbr 3accept 4acceptCharset 3accessKey 3
action 3activeElement 3align 1 4align 2 4
align 3 4align 4 4aLink 3alinkColor 3
allowTransparency 4alt 3altHTML 3altKey 4
altLeft 3appCodeName 3appMinorVersion 3appName 3
appVersion 3archive 3autocomplete 4availHeight 3
availLeft 3availTop 3availWidth 3axis 3
background 3balance 3BaseHref 3behavior 4
bgColor 3bgProperties 4blockDirection 4border 3
borderColor 3borderColorDark 3borderColorLight 3bottom 3
bottomMargin 3boundingHeight 3boundingLeft 3boundingTop 3
boundingWidth 3browserLanguage 3bufferDepth 4button 4
cancelBubble 4canHaveChildren 3canHaveHTML 3caption 3
cellIndex 3cellPadding 3cellSpacing 3charset 3
checked 4cite 3classid 3className 3
clear 4clientHeight 3clientLeft 3clientTop 3
clientWidth 3clientX 3clientY 3clipBottom 4
clipLeft 4clipRight 4clipTop 4closed 3
code 3codeBase 3codeType 3color 3
colorDepth 4cols 1 4cols 2 3cols 3 3
colSpan 3compact 3compatMode 3complete 3
constructor 3content 3contentEditable 4contentOverflow 3
contentWindow 3cookie 4cookieEnabled 4coords 3
Count 3cpuClass 4cssRules 3cssText 3
ctrlKey 4ctrlLeft 4cursor 4data 1 3
data TextNode 3dataFld 1 3dataFld event 3dataFormatAs 3
dataPageSize 3dataSrc 3dateTime 4declare 4
defaultCharset 3defaultChecked 3defaultSelected 4defaultStatus 3
defaultValue 3defer 4description 3designMode 4
deviceXDPI 3deviceYDPI 3dialogArguments 3dialogHeight 3
dialogLeft 3dialogTop 3dialogWidth 3dir 4
direction 4disabled 4doctype 3documentElement 3
domain 3dropEffect 4dynsrc 3E 3
effectAllowed 4encoding 3enctype 3event 3
expando 4face 3fgColor 3fieldDelim 3
fileCreatedDate 3fileModifiedDate 3filename 3fileSize 3
fileUpdatedDate 3firstChild 3fontSmoothingEnabled 4form 3
frame 4frameBorder 4frameElement 2frameSpacing 3
fromElement 3galleryImg 4hash 3hasLayout 4
headers 3height 1 3height 2 3hidden 4
hideFocus 4host 3hostname 3href 3
hreflang 3hspace 3htmlFor 3htmlText 3
httpEquiv 3id 3indeterminate 4index 3
innerHTML 3innerText 3isContentEditable 4isDisabled 4
isMap 4isMultiline 4isOpen 4isTextEdit 4
keyCode 3label 3lang 3language 1 4
language navigator 3lastChild 3lastModified 3layerX 3
layerY 3left 3leftMargin 3length 1 3
length 3 3length history 3link 3linkColor 3
LN10 3LN2 3LOG10E 3LOG2E 3
logicalXDPI 3logicalYDPI 3longDesc 3loop 3
lowsrc 3maxLength 3MAX_VALUE 3media 4
menuArguments 3method 4Methods 3MIN_VALUE 3
multiple 4name 1 3name 2 3nameProp 3
NEGATIVE_INFINITY 3nextPage 4nextSibling 3nodeName 4
nodeType 4nodeValue 4noHref 4noResize 4
noShade 4noWrap 4object 3offScreenBuffering 4
offsetHeight 3offsetLeft 3offsetParent 3offsetTop 3
offsetWidth 3offsetX 3offsetY 3onLine 4
onOffBehavior 2opener 3outerHTML 3outerText 3
ownerDocument 3owningElement 3pageX 3pageY 3
palette 3parent 3parentElement 3parentNode 3
parentStyleSheet 3parentTextEdit 3parentWindow 3pathname 3
PI 3platform 4pluginspage 3port 3
POSITIVE_INFINITY 3previousSibling 3profile 3propertyName 3
protocol 3pseudoClass 4qualifier 3readOnly 1 4
readOnly 2 4readyState 4reason 4recordNumber 3
recordset 3referrer 3rel 4repeat 4
returnValue 3rev 4right 3rightMargin 3
rowIndex 3rows 1 4rows 2 3rowSpan 3
rules 4saveType 4scheme 3scope 4
scopeName 3screenLeft 3screenTop 3screenX mouse 3
screenX window 3screenY mouse 3screenY window 3scroll 4
scrollAmount 3scrollDelay 3scrollHeight 3scrollLeft 3
scrollTop 3scrollWidth 3search 3sectionRowIndex 3
selected 4selectedIndex 3selector 3selectorText 3
self 3shape 4shiftKey 4shiftLeft 3
size font 3size hr 3size input 3size select 3
sourceIndex 3span 3specified 4SQRT1_2 3
SQRT2 3src 3srcElement 3srcFilter 3
srcUrn 3standBy 3start 1 4start ol 3
status 1 4status window 3suffixes 3summary 3
systemLanguage 3tabIndex 3tabStop 3tagName 3
tagUrn 3target 1 4target event 3text 2 3
text body 3text option 3text TextRange 3tFoot 3
tHead 3title 1 3title document 3title stylesheet 3
toElement 3top TextRectangle 3top window 3topMargin 3
trueSpeed 4type 1 3type button 4type event 3
type input 3type list 4type mimeType 3type param 3
type select 4type selection 4type style 4type stylesheet 3
type textarea 3typeDetail 3uniqueID 3units 3
updateInterval 4URL 3URLUnencoded 3urn 3
useMap 3userAgent 3userLanguage 3vAlign caption 4
vAlign table 4value attribute 3value input 3value li 3
value option select 3value param 3value textarea 3valueType 4
vcard_name 3version 3viewInheritStyle 4viewLink 3
viewMasterTab 4vLink 3vlinkColor 3volume 3
vspace 3wheelDelta 3width 1 3width 2 3
width 4 3width pre 3wrap 4x 3
XMLDocument 3y 3

Javascript Methods /

abs 3acos 3add namespaces 3add 3
addBehavior 3AddChannel 3AddDesktopComponent 3addElement 3
AddFavorite 3addImport 3addPageRule 2addReadRequest 3
addRule 3alert 3anchor 3appendChild 2
appendData 3applyElement 3asin 3assign 3
atan 3atan2 3attachEvent 3AutoCompleteSaveForm 3
AutoScan 3back 3big 3blink 3
blur 3bold 3ceil 3charAt 3
charCodeAt 3ChooseColorDlg 3clear 3clearAttributes 3
clearData 3clearInterval 3clearRequest 3clearTimeout 3
click 3cloneNode 3close 3collapse 3
compareEndPoints 3componentFromPoint 4concat 1 3concat 2 3
confirm 3contains 3cos 3createAttribute 3
createCaption 3createComment 3createControlRange 3createDocumentFragment 3
createElement 3createEventObject 3createPopup 3createRange 3
createStyleSheet 3createTextNode 3createTextRange 3createTFoot 3
createTHead 3deleteCaption 3deleteCell 3deleteData 3
deleteRow 3deleteTFoot 3deleteTHead 3detachEvent 3
doImport 3doReadRequest 3doScroll 3dragDrop 3
duplicate 3elementFromPoint 3empty 3escape 2
eval 2execCommand 3execScript 3exp 3
findText 3fireEvent 3firstPage 3floor 3
focus 3fontColor 3fontSize 3forward 3
fromCharCode 3getAdjacentText 3getAttribute 3getAttributeNode 3
getBookmark 3getCharset 3getClientRects 3getData 3
getDay 3getElementById 3getElementsByName 3getElementsByTagName 3
getExpression 3getFullYear 3getMilliseconds 3getMonth 3
getNamedItem 3getSeconds 3getTime 3getTimezoneOffset 3
getUTCDate 3getUTCDay 3getUTCHours 3getUTCMilliseconds 3
getUTCMinutes 3getUTCMonth 3getUTCSeconds 3getYear 3
hasChildNodes 3hasFocus 3hasOwnProperty 3hide 3
ImportExportFavorites 3indexOf 3inRange 3insertAdjacentElement 3
insertAdjacentText 3insertBefore 3insertCell 3insertData 3
insertRow 3isEqual 3isNaN 2isPrototypeOf 3
IsSubscribed 3italics 3item 3javaEnabled 3
join 3lastIndexOf 3lastPage 3link 3
localeCompare 3log 3match 3max 3
mergeAttributes 3min 3move 3moveBy 3
moveEnd 3moveRow 3moveStart 3moveTo 3
moveToBookmark 3moveToElementText 3moveToPoint 3namedItem 3
namedRecordset 3navigate 3NavigateAndFind 3nextPage 3
normalize 3open 3parentElement 3parse 3
parseFloat 2parseInt 2pasteHTML 3pop 3
pow 3previousPage 3print 3prompt 3
queryCommandEnabled 3queryCommandIndeterm 3queryCommandState 3queryCommandValue 3
recalc 3refresh plugin 3releaseCapture 3remove 3
removeAttribute 3removeAttributeNode 3removeBehavior 3removeChild 3
removeExpression 3removeNode 3removeRule 3replace location 3
replace String 3replaceChild 3replaceData 3replaceNode 3
reset 3resizeBy 3reverse 3round 3
scroll 3scrollBy 3scrollIntoView 3scrollTo 3
select form control 3select 3setActive 3setAttributeNode 3
setCapture 3setDate 3setExpression 3setFullYear 3
setHours 3setMilliseconds 3setMinutes 3setMonth 3
setSeconds 3setTime 3setTimeout 3setUTCDate 3
setUTCFullYear 3setUTCHours 3setUTCMilliseconds 3setUTCMinutes 3
setUTCMonth 3setUTCSeconds 3setYear 3shift 3
show 3ShowBrowserUI 3showHelp 3showModalDialog 3
showModelessDialog 3sin 3slice 3small 3
sort 3splice 3split 3splitText 3
sqrt 3start 3stop 3strike 3
sub 3submit 3substr 3substring 3
substringData 3sup 3swapNode 3tags 3
taintEnabled 3tan 3toExponential 3toFixed 3
toGMTString 3toLocaleLowerCase 3toLocaleString 3toLocaleUpperCase 3
toLowerCase 3toPrecision 3toSource 3toString 3
toUpperCase 3toUTCString 3unescape 2unshift 3
urns 3UTC 3valueOf 3write 3
writeln 3

Javascript Collections /

all 4anchors 4applets 4areas 4
attributes 4behaviorUrns 4blockFormats 4boundElements 4
cells 4childNodes 4children 4controlRange 3
elements 4embeds 4filters 4fonts 4
forms 4frames 4images 4imports 4
links 4mimeTypes 4namespaces 4options 4
pages 4plugins 1 4plugins 2 4rows 4
rules 4scripts 4styleSheets 4tBodies 4

Event Handlers Reference /

onAbort 4onActivate 4onAfterPrint 4onAfterUpdate 4
onBeforeActivate 4onBeforeCopy 4onBeforeCut 4onBeforeDeactivate 4
onBeforeEditFocus 4onBeforePaste 4onBeforePrint 4onBeforeUnload 4
onBeforeUpdate 4onBlur 4onBounce 4onCellChange 4
onChange 4onClick 4onContextMenu 4onControlSelect 4
onCopy 4onCut 4onDataAvailable 3onDatasetChange 4
onDatasetComplete 4onDblClick 4onDeactivate 4onDrag 4
onDragEnd 4onDragEnter 4onDragLeave 4onDragOver 4
onDragStart 4onDrop 4onError 4onErrorUpdate 4
onFilterChange 4onFinish 4onFocus 4onFocusIn 4
onFocusOut 4onHelp 4onKeyDown 4onKeyPress 4
onKeyUp 4onLayoutComplete 4onLoad 4onLoseCapture 4
onMouseDown 4onMouseEnter 4onMouseLeave 4onMouseMove 4
onMouseOut 4onMouseOver 4onMouseUp 4onMouseWheel 4
onMove 4onMoveEnd 4onMoveStart 4onPaste 4
onPropertyChange 4onReadyStateChange 4onReset 4onResize 4
onResizeEnd 4onResizeStart 4onRowEnter 4onRowExit 4
onRowsDelete 4onRowsInserted 4onScroll 4onSelect 4
onSelectionChange 4onSelectStart 4onStart 4onSubmit 4
onTimeError 4onUnload 4