Javascript Methods
Javascript Methods
Constructor Returns a reference to the Date function that created the object
Prototype Allows you to add properties and methods to the object
Constructor Returns a reference to the array function that created the object
index
input
Length Sets or returns the number of elements in an array
Prototype Allows you to add properties and methods to the object
Method
concat() Joins two or more arrays and returns the result
join() Puts all the elements of an array into a string. The elements are separated by a delimiter
pop() Removes and returns the last element of an array
push() Adds one or more elements to the end of an array and returns the new length
reverse() Reverses the order of the elements in an array
shift() Removes and returns the first element of an array
slice() Returns selected elements from an existing array
sort() Sorts the elements of an array
splice() Removes and adds new elements to an array
toSource() Represents the source code of an object
toString() Converts an array to a string and returns the result
unshift() Adds one or more elements to the beginning of an array and returns the new length
valueOf() Returns the primitive value of an Array object
Constructor Returns a reference to the Boolean function that created the object
Prototype Allows you to add properties and methods to the object
Constructor Returns a reference to the Number function that created the object
MAX_VALUE Returns the largest possible value in JavaScript
MIN_VALUE Returns the smallest possible value in JavaScript
NaN Represents "Not-a-number" value
NEGATIVE_INFINITY Represents a value that is less than MIN_VALUE
POSITIVE_INFINITY Represents a value that is greater than MAX_VALUE
Prototype Allows you to add properties and methods to the object
Top-level Functions
Top-level Properties
Window Object
The Window object is the top level object in the JavaScript hierarchy.
Navigator Object
The Navigator object is actually a JavaScript object, not an HTML DOM object.
availHeight Returns the height of the display screen (excluding the Windows Taskbar)
availWidth Returns the width of the display screen (excluding the Windows Taskbar)
bufferDepth Sets or returns the bit depth of the color palette in the off-screen bitmap buffer
colorDepth Returns the bit depth of the color palette on the destination device or buffer
deviceXDPI Returns the number of horizontal dots per inch of the display screen
deviceYDPI Returns the number of vertical dots per inch of the display screen
fontSmoothingEnabledReturns whether the user has enabled font smoothing in the display control panel
Height The height of the display screen
logicalXDPI Returns the normal number of horizontal dots per inch of the display screen
logicalYDPI Returns the normal number of vertical dots per inch of the display screen
pixelDepth Returns the color resolution (in bits per pixel) of the display screen
updateInterval Sets or returns the update interval for the screen
Width Returns width of the display screen
History Object
The History object is actually a JavaScript object, not an HTML DOM object.
Location Object
The Location object is actually a JavaScript object, not an HTML DOM object.
Hash Sets or returns the URL from the hash sign (#)
Host Sets or returns the hostname and port number of the current URL
Hostname Sets or returns the hostname of the current URL
Href Sets or returns the entire URL
Pathname Sets or returns the path of the current URL
Port Sets or returns the port number of the current URL
Protocol Sets or returns the protocol of the current URL
Search Sets or returns the URL from the question mark (?)
Document Object
The Document object represents the entire HTML document and can be used to access all elements in a page.
Button Object
The Button object represents a push button.
Event Handlers
Bubbles Returns a Boolean value that indicates whether or not an event is a bubbling event
Cancelable Returns a Boolean that indicates whether or not an event can be default action prevented
currentTarget Returns the element whose event listeners triggered the event
eventPhase Returns which phase of the event flow is currently being evaluated
Target Returns the element that triggered the event
timeStamp Returns the time stamp, in milliseconds, from the epoch (system start or event trigger)
Type Returns the name of the event
Form Object
The Form object represents an HTML form.
acceptCharset Sets or returns a list of possible character-sets for the form data
Action Sets or returns the action attribute of a form
Enctype Sets or returns the MIME type used to encode the content of a form
Id Sets or returns the id of a form
Length Returns the number of elements in a form
Method Sets or returns the HTTP method for sending data to the server
Name Sets or returns the name of a form
Target Sets or returns where to open the action-URL in a form
Image Object
The Image object represents an embedded image.
Align Sets or returns how to align an image according to the surrounding text
Alt Sets or returns an alternate text to be displayed, if a browser cannot show an image
Border Sets or returns the border around an image
Complete Returns whether or not the browser has finished loading the image
Height Sets or returns the height of an image
Hspace Sets or returns the white space on the left and right side of the image
Id Sets or returns the id of the image
isMap Returns whether or not an image is a server-side image map
longDesc Sets or returns a URL to a document containing a description of the image
Lowsrc Sets or returns a URL to a low-resolution version of an image
Name Sets or returns the name of an image
Src Sets or returns the URL of an image
useMap Sets or returns the value of the usemap attribute of an client-side image map
Vspace Sets or returns the white space on the top and bottom of the image
Width Sets or returns the width of an image
Button Object
The Button object represents a button in an HTML form.
Radio Object
The Radio object represents a radio button in an HTML form.
Text Object
The Text object represents a text-input field in an HTML form.
Link Object
The Link object element defines the relationship between two linked documents
Style object
The Style object represents an individual style statement.
Background properties
Layout properties
Clear Sets on which sides of an element other floating elements are not allowed
Clip Sets the shape of an element
Content Sets meta-information
counterIncrement Sets a list of counter names, followed by an integer. The integer indicates by how much the
counter is incremented for every occurrence of the element. The default is 1
counterReset Sets a list of counter names, followed by an integer. The integer gives the value that the
counter is set to on each occurrence of the element. The default is 0
cssFloat Sets where an image or a text will appear (float) in another element
Cursor Sets the type of cursor to be displayed
Direction Sets the text direction of an element
Display Sets how an element will be displayed
Height Sets the height of an element
markerOffset Sets the distance between the nearest border edges of a marker box and its principal box
Marks Sets whether cross marks or crop marks should be rendered just outside the page box edge
maxHeight Sets the maximum height of an element
maxWidth Sets the maximum width of an element
minHeight Sets the minimum height of an element
minWidth Sets the minimum width of an element
Overflow Specifies what to do with content that does not fit in an element box
verticalAlign Sets the vertical alignment of content in an element
Visibility Sets whether or not an element should be visible
Width Sets the width of an element
List properties
Positioning properties
Bottom Sets how far the bottom edge of an element is above/below the bottom edge of the parent
Left Sets how far the left edge of an element is to the right/left of the left edge of the parent
Position Places an element in a static, relative, absolute or fixed position
Right Sets how far the right edge of an element is to the left/right of the right edge of the parent
Top Sets how far the top edge of an element is above/below the top edge of the parent element
Zindex Sets the stack order of an element
Printing properties
Orphans Sets the minimum number of lines for a paragraph that must be left at the bottom of a page
Page Sets a page type to use when displaying an element
pageBreakAfter Sets the page-breaking behavior after an element
pageBreakBefore Sets the page-breaking behavior before an element
pageBreakInside Sets the page-breaking behavior inside an element
Size Sets the orientation and size of a page
Widows Sets the minimum number of lines for a paragraph that must be left at the top of a page
Table properties
borderCollapse Sets whether the table border are collapsed into a single border or detached
borderSpacing Sets the distance that separates cell borders
captionSide Sets the position of the table caption
emptyCells Sets whether or not to show empty cells in a table
tableLayout Sets the algorithm used to display the table cells, rows, and columns
Text properties
Textarea object
Textarea Object Properties