JavaScript Reference examples (example source code) Organized by topic





Javascript Objects /

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

Javascript Properties /

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

Javascript Methods /

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

Javascript Collections /

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

Event Handlers Reference /

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