Document Object
❑ Event Object
❑ Element Object
❑ Anchor Object
❑ Area Object
❑ Base Object
❑ Body Object
❑ Button Object (Push Button)
❑ Form Object
❑ Frame/IFrame Object
❑ Frameset Object
❑ Image Object
❑ Button Object
❑ Checkbox Object
❑ FileUpload Object
❑ Hidden Object
❑ Password Object
❑ Radio Object
❑ Reset Object
❑ Submit Object
❑ Text Object
❑ Link Object
❑ Meta Object
❑ Object Object
❑ Option Object
❑ Select Object
❑ Style Object
❑ Table Object
❑ TableCell Object
❑ TableRow Object
❑ Textarea Object
The World Wide Web Consortium (W3C) is an international community that
develops standards to ensure the long-term growth of the Web. The W3C DOM
page is located at http://www.w3.org/DOM/.
document Object
Each HTML document loaded into a browser window becomes a Document
object.
The Document object provides access to all HTML elements in a page, from within
a script.
document Object collections
anchors[] Returns an array of all the anchors in the document Yes
forms[] Returns an array of all the forms in the document Yes
images[] Returns an array of all the images in the document Yes
links[] Returns an array of all the links in the document Yes
The Document object is also part of the Window object and can be accessed
through the window.documentproperty.
Ti p
Learn javascript and Ajax with w3schools
216
document Object properties
property description W3c
cookie Returns all name/value pairs of cookies in the document Yes
documentMode
Returns the mode used by the browser to render the docu-ment
No
domain
Returns the domain name of the server that loaded the docu-ment
Yes
lastModified Returns the date and time the document was last modified No
readyState Returns the (loading) status of the document No
referrer
Returns the URL of the document that loaded the current
document
Yes
title Sets or returns the title of the document Yes
URL Returns the full URL of the document Yes
document Object Methods
Method description W3c
close()
Closes the output stream previously opened with
document.open()
Yes
getElementById() Accesses the first element with the specified id Yes
getElementsByName() Accesses all elements with a specified name Yes
getElementsByTagName() Accesses all elements with a specified tagname Yes
open()
Opens an output stream to collect the output from
document.write() or document.writeln()
Yes
write()
Writes HTML expressions or JavaScript code to a
document
Yes
writeln()
Same as write(), but adds a newline character after
each statement
Yes
event Object
The Event object gives you information about an event that has occurred.
The Event object represents the state of an event, such as the element in which the
event occurred, the state of the keyboard keys, the location of the mouse, and the
state of the mouse buttons.
Events are normally used in combination with functions, and the function will not
be executed before the event occurs!
event Handlers
New to HTML 4.0 was the ability to let HTML events trigger actions in the
browser, like starting a JavaScript when a user clicks on an HTML element. Follow-ing is a list of the attributes that can be inserted into HTML tags to define event
actions.
IE: Internet Explorer; F: Firefox; O: Opera; W3C: W3C Standard.
Attribute The event occurs when... ie F O W3c
onblur An element loses focus 3 1 9 Yes
onchange The content of a field changes 3 1 9 Yes
onclick Mouse clicks an object 3 1 9 Yes
ondblclick Mouse double-clicks an object 4 1 9 Yes
onerror
An error occurs when loading a document or an
image
4 1 9 Yes
onfocus An element gets focus 3 1 9 Yes
onkeydown A keyboard key is pressed 3 1 NoYes
onkeypress A keyboard key is pressed or held down 3 1 9 Yes
onkeyup A keyboard key is released 3 1 9 Yes
onload A page or an image is finished loading 3 1 9 Yes
onmousedown A mouse button is pressed 4 1 9 Yes
onmousemove The mouse is moved 3 1 9 Yes
onmouseout The mouse is moved off an element 4 1 9 Yes
onmouseover The mouse is moved over an element 3 1 9 Yes
onmouseup A mouse button is released 4 1 9 Yes
onresize A window or frame is resized 4 1 9 Yes
onselect Text is selected 3 1 9 Yes
onunload The user exits the page 3 1 9 Yes
Mouse / Keyboard Attributes
property description ie F O W3c
altKey
Returns whether the Alt key was pressed when an
event was triggered
6 1 9 Yes
button
Returns which mouse button was clicked when an
event was triggered
6 1 9 Yes
clientX
Returns the horizontal coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
clientY
Returns the vertical coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
ctrlKey
Returns whether the Ctrl key was pressed when an
event was triggered
6 1 9 Yes
metaKey
Returns whether the meta key was pressed when
an event was triggered
6 1 9 Yes
relatedTarget
Returns the element related to the element that
triggered the event
No 1 9 Yes
screenX
Returns the horizontal coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
screenY
Returns the vertical coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
shiftKey
Returns whether the Shift key was pressed when an
event was triggered
6 1 9 Yes
Learn javascript and Ajax with w3schools
218
Other event Attributes
property description ie F O W3c
bubbles
Returns a Boolean value that indicates whether an
event is a bubbling event
No 1 9 Yes
cancelable
Returns a Boolean value that indicates whether an
event can have its default action prevented
No 1 9 Yes
currentTarget
Returns the element whose event listeners trig-gered the event
No 1 9 Yes
eventPhase
Returns which phase of the event flow is currently
being evaluated
Yes
target Returns the element that triggered the event No 1 9 Yes
timeStamp
Returns the time stamp, in milliseconds, from the
epoch (system start or event trigger)
No 1 9 Yes
type Returns the name of the event 6 1 9 Yes
element Object
The collections, properties, methods, and events in the following tables can be used
on all HTML elements.
element Object collections
W3C: W3C Standard.
collection description W3c
attributes[] Returns an array of the attributes of an element Yes
childNodes[] Returns an array of child nodes for an element Yes
element Object properties
property description W3c
accessKey Sets or returns an accesskey for an element Yes
className Sets or returns the class attribute of an element Yes
clientHeight
Returns the viewable height of the content on a page (not
including borders, margins, or scrollbars)
Yes
clientWidth
Returns the viewable width of the content on a page (not
including borders, margins, or scrollbars)
Yes
dir Sets or returns the text direction of an element Yes
disabled Sets or returns the disabled attribute of an element Yes
firstChild Returns the first child of an element Yes
height Sets or returns the height attribute of an element Yes
id Sets or returns the id of an element Yes
innerHTML Sets or returns the HTML contents (+text) of an element Yes
lang Sets or returns the language code for an element Yes
Appendix B: HTML dOM Objects
219
property description W3c
lastChild Returns the last child of an element Yes
length Does not apply to all objects. See specific object type. Yes
nextSibling Returns the element immediately following an element Yes
nodeName Returns the tagname of an element (in uppercase) Yes
nodeType Returns the type of the element Yes
nodeValue Returns the value of the element Yes
offsetHeight
Returns the height of an element, including borders and pad-ding if any, but not margins
No
offsetLeft
Returns the horizontal offset position of the current element
relative to its offset container
Yes
offsetParent Returns the offset container of an element Yes
offsetTop
Returns the vertical offset position of the current element
relative to its offset container
Yes
offsetWidth
Returns the width of an element, including borders and pad-ding if any, but not margins
No
ownerDocument Returns the root element (document object) for an element Yes
parentNode Returns the parent node of an element Yes
previousSibling Returns the element immediately before an element Yes
scrollHeight
Returns the entire height of an element (including areas hid-den with scrollbars)
Yes
scrollLeft
Returns the distance between the actual left edge of an ele-ment and its left edge currently in view
Yes
scrollTop
Returns the distance between the actual top edge of an ele-ment and its top edge currently in view
Yes
scrollWidth
Returns the entire width of an element (including areas hid-den with scrollbars)
Yes
style Sets or returns the style attribute of an element Yes
tabIndex Sets or returns the tab order of an element Yes
tagName Returns the tagname of an element as a string (in uppercase) Yes
title Sets or returns the title attribute of an element Yes
width Sets or returns the width attribute of an element Yes
appendChild() Adds a new child element to the end of the list of
children of the element
Yes
blur() Removes focus from an element Yes
click() Executes a click on an element Yes
cloneNode() Clones an element Yes
focus() Gives focus to an element Yes
getAttribute() Returns the value of an attribute Yes
getElementsByTagName() Accesses all elements with a specified tagname Yes
(continued)
hasChildNodes() Returns whether an element has any child elements Yes
insertBefore() Inserts a new child element before an existing child
element
Yes
item() Returns an element based on its index within the
document tree
Yes
normalize() Puts all text nodes underneath this element (including
attributes) into a “normal” form where only structure
(for example, elements, comments, processing instruc-tions, CDATA sections, and entity references) separates
Text nodes, that is, there are neither adjacent Text
nodes nor empty Text nodes
Yes
removeAttribute() Removes a specified attribute from an element Yes
removeChild() Removes a child element Yes
replaceChild() Replaces a child element Yes
setAttribute() Adds a new attribute to an element Yes
toString() Converts an element to a string Yes
element Object events
event description W3c
onblur When an element loses focus Yes
onclick When a mouse clicks on an element Yes
ondblclick When a mouse double-clicks on an element Yes
onfocus When an element gets focus Yes
onkeydown When a keyboard key is pressed Yes
onkeypress When a keyboard key is pressed or held down Yes
onkeyup When a keyboard key is released Yes
onmousedown When a mouse button is pressed Yes
onmousemove When the mouse is moved Yes
onmouseout When the mouse cursor leaves an element Yes
onmouseover When the mouse cursor enters an element Yes
onmouseup When a mouse button is released Yes
onresize When an element is resized Yes
Anchor Object
The Anchor object represents an HTML hyperlink.
For each <a> tag in an HTML document, an Anchor object is created.
An anchor allows you to create a link to another document (with the href attri-bute) or to a different point in the same document (with the name attribute).
You can access an anchor by using getElementById() or by searching through
the anchors[] array of the Document object.
(continued)
charset Sets or returns the value of the charset attribute of a link Yes
href Sets or returns the value of the href attribute of a link Yes
hreflang Sets or returns the value of the hreflang attribute of a link Yes
name Sets or returns the value of the name attribute of a link Yes
rel Sets or returns the value of the rel attribute of a link Yes
rev Sets or returns the value of the rev attribute of a link Yes
target Sets or returns the value of the target attribute of a link Yes
type Sets or returns the value of the type attribute of a link Yes
standard properties, Methods, and events
The Anchor object also supports the standard properties, methods, and events.
Area Object
The Area object represents an area inside an HTML image map (an image map is
an image with clickable areas).
For each <area> tag in an HTML document, an Area object is created.
Area Object properties
alt Sets or returns the value of the alt attribute of an area Yes
coords Sets or returns the value of the coords attribute of an area Yes
hash Sets or returns the anchor part of the href attribute value Yes
host Sets or returns the hostname:port part of the href attribute value Yes
hostname Sets or returns the hostname part of the href attribute value Yes
href Sets or returns the value of the href attribute of an area Yes
noHref Sets or returns the value of the nohref attribute of an area Yes
pathname Sets or returns the pathname part of the href attribute value Yes
port Sets or returns the port part of the href attribute value Yes
protocol Sets or returns the protocol part of the href attribute value Yes
search Sets or returns the querystring part of the href attribute value Yes
shape Sets or returns the value of the shape attribute of an area Yes
target Sets or returns the value of the target attribute of an area Yes
standard properties, Methods, and events
The Area object also supports the standard properties, methods, and events.
Base Object
The Base object represents an HTML base element.
The base element is used to specify a default address or a default target for all links
on a page.
For each <base> tag in an HTML document, a Base object is created.
Base Object properties
href Sets or returns the value of the href attribute in a base element Yes
target Sets or returns the value of the target attribute in a base element Yes
standard properties, Methods, and events
The Base object also supports the standard properties, methods, and events.
Body Object
The Body object represents the HTML body element.
The Body element defines a document’s body.
The Body element contains all the contents of an HTML document, such as text,
hyperlinks, images, tables, lists, and so on.
Body Object properties
aLink Sets or returns the value of the alink attribute of the body element Yes
background
Sets or returns the value of the background attribute of the body
element
Yes
bgColor Sets or returns the value of the bgcolor attribute of the body element Yes
link Sets or returns the value of the link attribute of the body element Yes
text Sets or returns the value of the text attribute of the body element Yes
vLink Sets or returns the value of the vlink attribute of the body element Yes
standard properties, Methods, and events
The Body object also supports the standard properties, methods, and events.
Button Object (push Button)
The Button object represents a Button Object (Push Button).
For each <button> tag in an HTML document, a Button object is created.
Inside an HTML Button element you can put content like text or images. This is
the difference between this element and buttons created with the input element.
Button Object properties
\
form Returns a reference to the form that contains a button Yes
name Sets or returns the value of the name attribute of a button Yes
type Sets or returns the type of a button Yes
value Sets or returns the value of the value attribute of a button Yes
standard properties, Methods, and events
The Button object also supports the standard properties, methods, and events.
Form Object
The Form object represents an HTML form.
For each <form> tag in an HTML document, a Form object is created.
Forms are used to collect user input and contain input elements like text fields,
check boxes, radio buttons, Submit buttons, and more. A form also can contain
select menus and textarea, fieldset, legend, and label elements.
Forms are used to pass data to a server.
elements[] Returns an array of all elements in a form Yes
acceptCharset Sets or returns the value of the accept-charset attribute in a form Yes
action Sets or returns the value of the action attribute in a form Yes
enctype Sets or returns the value of the enctype attribute in a form Yes
length Returns the number of elements in a form Yes
method Sets or returns the value of the method attribute in a form Yes
name Sets or returns the value of the name attribute in a form Yes
target Sets or returns the value of the target attribute in a form Yes
\
reset() Resets a form Yes
submit() Submits a form Yes
Form Object events
event The event occurs when... W3c
onreset The Reset button is clicked Yes
onsubmit The Submit button is clicked Yes
standard properties, Methods, and events
The Form object also supports the standard properties, methods, and events.
Frame/iFrame Object
The Frame object represents an HTML frame.
The <frame> tag defines one particular window (frame) within a frameset.
For each <frame> tag in an HTML document, a Frame object is created.
The IFrame object represents an HTML inline frame.
The <iframe> tag defines an inline frame that contains another document.
For each <iframe> tag in an HTML document, an IFrame object is created.
align Sets or returns the value of the align attribute in an iframe Yes
contentDocument Returns the document object generated by a frame/iframe Yes
contentWindow Returns the window object generated by a frame/iframe No
frameBorder
Sets or returns the value of the frameborder attribute in a
frame/iframe
Yes
height Sets or returns the value of the height attribute in an iframe Yes
longDesc
Sets or returns the value of the longdesc attribute in a frame/
iframe
Yes
marginHeight
Sets or returns the value of the marginheight attribute in a
frame/iframe
Yes
marginWidth
Sets or returns the value of the marginwidth attribute in a
frame/iframe
Yes
name
Sets or returns the value of the name attribute in a frame/
iframe
Yes
noResize Sets or returns the value of the noresize attribute in a frame Yes
scrolling
Sets or returns the value of the scrolling attribute in a frame/
iframe
Yes
src Sets or returns the value of the src attribute in a frame/iframe Yes
width Sets or returns the value of the width attribute in an iframe Yes
standard properties, Methods, and events
The Frame and IFrame objects also support the standard properties, methods, and
events.
Frameset Object
The Frameset object represents an HTML frameset.
The HTML frameset element holds two or more frame elements. Each frame ele-ment holds a separate document.
The HTML frameset element states only how many columns or rows there will be
in the frameset.
Frameset Object properties
border Sets or returns the width of the border between frames Yes
cols Sets or returns the value of the cols attribute in a frameset Yes
rows Sets or returns the value of the rows attribute in a frameset Yes
onload Script to be run when a document loads Yes
standard properties, Methods, and events
The Frameset object also supports the standard properties, methods, and events.
image Object
The Image object represents an embedded image.
For each <img> tag in an HTML document, an Image object is created.
image Object properties
align Sets or returns how to align an image according to the surrounding
text
Yes
alt Sets or returns an alternate text to be displayed if a browser cannot
show an image
Yes
border Sets or returns the border around an image Yes
complete Returns whether the browser has finished loading the image No
height Sets or returns the height of an image Yes
href
hspace Sets or returns the white space on the left and right side of the image Yes
isMap Returns whether an image is a server-side image map Yes
longDesc Sets or returns a URL to a document containing a description of the
image
Yes
lowsrc Sets or returns a URL to a low-resolution version of an image No
name Sets or returns the name of an image Yes
src Sets or returns the URL of an image Yes
useMap Sets or returns the value of the usemap attribute of a client-side im-age map
Yes
vspace Sets or returns the white space on the top and bottom of the image Yes
width Sets or returns the width of an image Yes
onabort Loading of an image is interrupted Yes
onerror An error occurs when loading an image Yes
onload An image is finished loading Yes
standard properties, Methods, and events
The Image object also supports the standard properties, methods, and events.
Button Object
The Button object represents a button in an HTML form.
For each instance of an <input type="button"> tag in an HTML form, a
Button object is created.
You can access a button by searching through the elements[] array of the form or
by using document.getElementById().
Button Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port buttons
Yes
disabled Sets or returns whether a button should be disabled Yes
form Returns a reference to the form that contains the button Yes
name Sets or returns the name of a button Yes
type Returns the type of form element a button is Yes
value Sets or returns the text that is displayed on the button Yes
standard properties, Methods, and events
The Button object also supports the standard properties, methods, and events.
checkbox Object
The Checkbox object represents a check box in an HTML form.
For each <input type="checkbox"> tag in an HTML form, a Checkbox object
is created.
You can access a check box by searching through the elements[] array of the
form, or by using document.getElementById().
Learn javascript and Ajax with w3schools
alt Sets or returns an alternate text to display if a browser does not
support check boxes
Yes
checked Sets or returns whether a check box should be checked Yes
defaultChecked Returns the default value of the checked attribute Yes
disabled Sets or returns whether a check box should be disabled Yes
form Returns a reference to the form that contains the check box Yes
name Sets or returns the name of a check box Yes
type Returns the type of form element a check box is Yes
value Sets or returns the value of the value attribute of a check box Yes
standard properties, Methods, and events
The Checkbox object also supports the standard properties, methods, and events.
FileUpload Object
For each <input type="file"> tag in an HTML form, a FileUpload object is
created.
You can access a FileUpload object by searching through the elements[] array of
the form or by using document.getElementById().
FileUpload Object properties
accept Sets or returns a comma-separated list of MIME types that indicates
the MIME type of the file transfer
Yes
alt Sets or returns an alternate text to display if the browser does not
support <input type=”file”>
Yes
defaultValue Sets or returns the initial value of the FileUpload object Yes
disabled Sets or returns whether the FileUpload object should be disabled Yes
form Returns a reference to the form that contains the FileUpload object Yes
name Sets or returns the name of the FileUpload object Yes
type Returns the type of the form element. For a FileUpload object it will
be “file”
Yes
value Returns the filename of the FileUpload object after the text is set by
user input
Yes
select() Selects the FileUpload object Yes
standard properties, Methods, and events
The FileUpload object also supports the standard properties, methods, and events.
Hidden Object
The Hidden object represents a hidden input field in an HTML form.
For each <input type="hidden"> tag in an HTML form, a Hidden object is
created.
You can access a hidden input field by searching through the elements[] array of
the form, or by using document.getElementById().
Hidden Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port hidden fields
Yes
form Returns a reference to the form that contains the hidden field Yes
name Sets or returns the name of a hidden field Yes
type Returns the type of form element a hidden input field is Yes
value Sets or returns the value of the value attribute of the hidden field Yes
standard properties, Methods, and events
The Hidden object also supports the standard properties, methods, and events.
password Object
The Password object represents a password field in an HTML form.
For each <input type="password"> tag in an HTML form, a Password object
is created.
You can access a password field by searching through the elements[] array of the
form or by using document.getElementById().
alt Sets or returns an alternate text to display if a browser does not sup-port password fields
Yes
defaultValue Sets or returns the default value of a password field Yes
disabled Sets or returns whether a password field should be disabled Yes
form Returns a reference to the form that contains the password field Yes
maxLength Sets or returns the maximum number of characters in a password
field
Yes
name Sets or returns the name of a password field Yes
readOnly Sets or returns whether a password field should be read-only Yes
size Sets or returns the size of a password field Yes
type Returns the type of form element a password field is Yes
value Sets or returns the value of the value attribute of the password field Yes
password Object Methods
Method description W3c
select() Selects the text in a password field Yes
standard properties, Methods, and events
The Password object also supports the standard properties, methods, and events.
Radio Object
The Radio object represents a radio button in an HTML form.
For each <input type="radio"> tag in an HTML form, a Radio object is
created.
You can access a Radio object by searching through the elements[] array of the
form or by using document.getElementById().
Radio Object properties
W3C: W3C Standard.
property description W3c
alt Sets or returns an alternate text to display if a browser does not
support radio buttons
Yes
checked Sets or returns the state of a radio button Yes
defaultChecked Returns the default state of a radio button Yes
disabled Sets or returns whether a radio button should be disabled Yes
form Returns a reference to the form that contains the radio button Yes
name Sets or returns the name of a radio button Yes
type Returns the type of form element a radio button is Yes
value Sets or returns the value of the value attribute of the radio button Yes
standard properties, Methods, and events
The Radio object also supports the standard properties, methods, and events.
Reset Object
The Reset object represents a reset button in an HTML form.
For each <input type="reset"> tag in an HTML form, a Reset object is
created.
You can access a reset button by searching through the elements[] array of the
form or by using document.getElementById().
Reset Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port reset buttons
Yes
disabled Sets or returns whether a reset button should be disabled Yes
form Returns a reference to the form that contains the reset button Yes
name Sets or returns the name of a reset button Yes
type Returns the type of form element a reset button is Yes
value Sets or returns the text that is displayed on a reset button Yes
standard properties, Methods, and events
The Reset object also supports the standard properties, methods, and events.
submit Object
The Submit object represents a submit button in an HTML form.
For each <input type="submit"> tag in an HTML form, a Submit object is
created.
You can access a submit button by searching through the elements[] array of the
form or by using document.getElementById().
submit Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port submit buttons
Yes
disabled Sets or returns whether a submit button should be disabled Yes
form Returns a reference to the form that contains the submit button Yes
name Sets or returns the name of a submit button Yes
type Returns the type of form element a submit button is Yes
value Sets or returns the text that is displayed on a submit button Yes
standard properties, Methods, and events
The Submit object also supports the standard properties, methods, and events.
Text Object
The Text object represents a text-input field in an HTML form.
For each <input type="text"> tag in an HTML form, a Text object is created.
You can access a text-input field by searching through the elements[] array of the
form, or by using document.getElementById().
Text Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port text fields
Yes
defaultValue Sets or returns the default value of a text field Yes
disabled Sets or returns whether a text field should be disabled Yes
form Returns a reference to the form that contains the text field Yes
maxLength Sets or returns the maximum number of characters in a text field Yes
name Sets or returns the name of a text field Yes
readOnly Sets or returns whether a text field should be read-only Yes
size Sets or returns the size of a text field Yes
type Returns the type of form element a text field is Yes
value Sets or returns the value of the value attribute of a text field Yes
\
select() Selects the content of a text field Yes
standard properties, Methods, and events
The Text object also supports the standard properties, methods, and events.
Link Object
The Link object represents an HTML link element.
A link element defines the relationship between two linked documents.
The link element is defined in the head section of an HTML document.
Link Object properties
charset Sets or returns the character encoding of the target URL Yes
disabled Sets or returns whether the target URL should be disabled Yes
href Sets or returns the URL of a linked resource Yes
hreflang Sets or returns the base language of the target URL Yes
media Sets or returns on what device the document will be displayed Yes
name Sets or returns the name of a <link> element Yes
rel Sets or returns the relationship between the current document and
the target URL
Yes
rev Sets or returns the relationship between the target URL and the cur-rent document
Yes
type Sets or returns the MIME type of the target URL Yes
standard properties, Methods, and events
The Link object also supports the standard properties, methods, and events.
Meta Object
The Meta object represents an HTML meta element.
Metadata is information about data.
The <meta> tag provides metadata about the HTML document. Metadata will not
be displayed on the page, but will be machine parsable.
Meta elements are typically used to specify page description, keywords, author of
the document, last modified, and other metadata.
The <meta> tag always goes inside the head element.
Meta Object properties
W3C: W3C Standard.
property description W3c
content Sets or returns the value of the content attribute of a <meta>
element
Yes
httpEquiv Connects the content attribute to an HTTP header Yes
name Connects the content attribute to a name Yes
scheme Sets or returns the format to be used to interpret the value of the
content attribute
Yes
standard properties, Methods, and events
The Meta object also supports the standard properties, methods, and events.
Object Object
The Object object represents an HTML object element.
The <object> tag is used to include objects such as images, audio, videos, Java
applets, ActiveX, PDF, and Flash into a Web page.
Object Object properties
align Sets or returns the alignment of the object according to the sur-rounding text
Yes
archive Sets or returns a string that can be used to implement your own
archive functionality for the object
Yes
border Sets or returns the border around the object Yes
code Sets or returns the URL of the file that contains the compiled Java
class
Yes
codeBase Sets or returns the URL of the component Yes
codeType Sets or retrieves the Internet media type for the code associated with
the object. Read only.
Yes
data A URL specifying the location of the object’s data Yes
declare Declare (for future reference), but do not instantiate, this object Yes
form Returns a reference to the object’s parent form Yes
height Sets or returns the height of the object Yes
hspace Sets or returns the horizontal margin of the object Yes
name Sets or returns the name of the object Yes
standby Sets or returns a message when loading the object Yes
type Sets or returns the content type for data downloaded via the data
attribute
Yes
useMap Use client-side image map Yes
vspace Sets or returns the vertical margin of the object Yes
width Sets or returns the width of the object Yes
standard properties, Methods, and events
The Object object also supports the standard properties, methods, and events.
Option Object
The Option object represents an option in a drop-down list in an HTML form.
For each <option> tag in an HTML form, an Option object is created.
You can access an Option object by searching through the elements[] array of the
form, or by using document.getElementById().
Option Object properties
defaultSelected Returns the default value of the selected attribute Yes
disabled Sets or returns whether an option should be disabled Yes
form Returns a reference to the form that contains an option Yes
index Returns the index position of an option in a drop-down list Yes
label Sets or returns a label for an option (only for option-groups) Yes
selected Sets or returns the value of the selected attribute Yes
text Sets or returns the text value of an option Yes
value Sets or returns the value to be sent to the server Yes
standard properties, Methods, and events
The Option object also supports the standard properties, methods, and events.
select Object
The Select object represents a drop-down list in an HTML form.
For each <select> tag in an HTML form, a Select object is created.
You can access a Select object by searching through the elements[] array of the
form or by using document.getElementById().
select Object collections
options[] Returns an array of all the options in a drop-down list Yes
select Object properties
property description W3c
disabled Sets or returns whether a drop-down list should be disabled Yes
form Returns a reference to the form that contains the drop-down list Yes
length Returns the number of options in a drop-down list Yes
multiple Sets or returns whether multiple items can be selected Yes
name Sets or returns the name of a drop-down list Yes
selectedIndex Sets or returns the index of the selected option in a drop-down
list
Yes
size Sets or returns the number of visible rows in a drop-down list Yes
type Returns the type of form element a drop-down list is Yes
select Object Methods
Method description W3c
add() Adds an option to a drop-down list Yes
remove() Removes an option from a drop-down list Yes
standard properties, Methods, and events
The Select object also supports the standard properties, methods, and events.
style Object
The Style object represents an individual style statement.
The Style object can be accessed from the document or from the elements to which
that style is applied.
Syntax for using the Style object properties:
document.getElementById("id").style.property="value"
The Style object property categories are as follows:
8 Background
8 Border and Margin
8 Layout
8 List
8 Misc
8 Positioning
8 Printing
8 Table
8 Text
Background properties
background Sets all background properties Yes
backgroundAttachment Sets whether a background-image is fixed or scrolls
with the page
Yes
backgroundColor Sets the background-color of an element Yes
backgroundImage Sets the background-image of an element Yes
backgroundPosition Sets the starting position of a background-image Yes
backgroundPositionX Sets the x-coordinates of the backgroundPosition
property
No
backgroundPositionY Sets the y-coordinates of the backgroundPosition
property
No
backgroundRepeat Sets if/how a background-image will be repeated Yes
Border and Margin properties
property description W3c
border Sets all properties for the four borders Yes
borderBottom Sets all properties for the bottom border Yes
borderBottomColor Sets the color of the bottom border Yes
borderBottomStyle Sets the style of the bottom border Yes
borderBottomWidth Sets the width of the bottom border Yes
(continued)
borderColor Sets the color of all four borders (can have up to four colors) Yes
borderLeft Sets all properties for the left border Yes
borderLeftColor Sets the color of the left border Yes
borderLeftStyle Sets the style of the left border Yes
borderLeftWidth Sets the width of the left border Yes
borderRight Sets all properties for the right border Yes
borderRightColor Sets the color of the right border Yes
borderRightStyle Sets the style of the right border Yes
borderRightWidth Sets the width of the right border Yes
borderStyle Sets the style of all four borders (can have up to four styles) Yes
borderTop Sets all properties for the top border Yes
borderTopColor Sets the color of the top border Yes
borderTopStyle Sets the style of the top border Yes
borderTopWidth Sets the width of the top border Yes
borderWidth Sets the width of all four borders (can have up to four
widths)
Yes
margin Sets the margins of an element (can have up to four values) Yes
marginBottom Sets the bottom margin of an element Yes
marginLeft Sets the left margin of an element Yes
marginRight Sets the right margin of an element Yes
marginTop Sets the top margin of an element Yes
outline Sets all outline properties Yes
outlineColor Sets the color of the outline around a element Yes
outlineStyle Sets the style of the outline around an element Yes
outlineWidth Sets the width of the outline around an element Yes
padding Sets the padding of an element (can have up to four values) Yes
paddingBottom Sets the bottom padding of an element Yes
paddingLeft Sets the left padding of an element Yes
paddingRight Sets the right padding of an element Yes
paddingTop Sets the top padding of an element Yes
Layout properties
property description W3c
clear Sets on which sides of an element other floating elements
are not allowed
Yes
clip Sets the shape of an element Yes
content Sets meta-information Yes
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
Yes
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
Yes
(continued)
cssFloat Sets where an image or a text will appear (float) in another
element
Yes
cursor Sets the type of cursor to be displayed Yes
direction Sets the text direction of an element Yes
display Sets how an element will be displayed Yes
height Sets the height of an element Yes
markerOffset Sets the distance between the nearest border edges of a
marker box and its principal box
Yes
marks Sets whether cross marks or crop marks should be rendered
just outside the page box edge
Yes
maxHeight Sets the maximum height of an element Yes
maxWidth Sets the maximum width of an element Yes
minHeight Sets the minimum height of an element Yes
minWidth Sets the minimum width of an element Yes
overflow Specifies what to do with content that does not fit in an
element box
Yes
verticalAlign Sets the vertical alignment of content in an element Yes
visibility Sets whether an element should be visible Yes
width Sets the width of an element Yes
listStyle Sets all the properties for a list Yes
listStyleImage Sets an image as the list-item marker Yes
listStylePosition Positions the list-item marker Yes
listStyleType Sets the list-item marker type Yes
Misc properties
property description W3c
cssText Contains the entire contents of the stylesheet. ieonly
property
positioning properties
property description W3c
bottom Sets how far the bottom edge of an element is above/be-low the bottom edge of the parent element
Yes
left Sets how far the left edge of an element is to the right/left
of the left edge of the parent element
Yes
position Places an element in a static, relative, absolute, or fixed posi-tion
Yes
(continued)
right Sets how far the right edge of an element is to the left/right
of the right edge of the parent element
Yes
top Sets how far the top edge of an element is above/below the
top edge of the parent element
Yes
zIndex Sets the stack order of an element Yes
printing properties
property description W3c
orphans Sets the minimum number of lines for a paragraph that
must be left at the bottom of a page
Yes
page Sets a page type to use when displaying an element Yes
pageBreakAfter Sets the page-breaking behavior after an element Yes
pageBreakBefore Sets the page-breaking behavior before an element Yes
pageBreakInside Sets the page-breaking behavior inside an element Yes
size Sets the orientation and size of a page Yes
widows Sets the minimum number of lines for a paragraph that
must be left at the top of a page
Yes
Table properties
property description W3c
borderCollapse Sets whether the table borders are collapsed into a single
border or detached as in standard HTML
Yes
borderSpacing Sets the distance that separates cell borders Yes
captionSide Sets the position of the table caption Yes
emptyCells Sets whether to show empty cells in a table Yes
tableLayout Sets the algorithm used to display the table cells, rows, and
columns
Yes
Text properties
property description W3c
color Sets the color of the text Yes
font Sets all font properties Yes
fontFamily Sets the font of an element Yes
fontSize Sets the font-size of an element Yes
fontSizeAdjust Sets/adjusts the size of text Yes
fontStretch Sets how to condense or stretch a font Yes
fontStyle Sets the font-style of an element Yes
fontVariant Displays text in a small-caps font Yes
fontWeight Sets the boldness of the font Yes
letterSpacing Sets the space between characters Yes
lineHeight Sets the distance between lines Yes
(continued)
quotes Sets which quotation marks to use in text Yes
textAlign Aligns the text Yes
textDecoration Sets the decoration of text Yes
textIndent Indents the first line of text Yes
textShadow Sets the shadow effect of text Yes
textTransform Sets capitalization effect on text Yes
unicodeBidi Sets the Unicode bidirectional property Yes
whiteSpace Sets how to handle line breaks and white space in text Yes
wordSpacing Sets the space between words in a text Yes
Table Object
The Table object represents an HTML table.
For each <table> tag in an HTML document, a Table object is created.
Table Object collections
W3C: W3C Standard.
collection description W3c
cells[] Returns an array containing each cell in a table No
rows[] Returns an array containing each row in a table Yes
tBodies[] Returns an array containing each tbody in a table Yes
Table Object properties
property description W3c
border Sets or returns the width of the table border Yes
caption Sets or returns the caption of a table Yes
cellPadding Sets or returns the amount of space between the cell border and cell
content
Yes
cellSpacing Sets or returns the amount of space between the cells in a table Yes
frame Sets or returns the outer borders of a table Yes
rules Sets or returns the inner borders of a table Yes
summary Sets or returns a description of a table Yes
tFoot Returns the tFoot object of a table Yes
tHead Returns the tHead object of a table Yes
width Sets or returns the width of a table Yes
createCaption() Creates a caption element for a table Yes
createTFoot() Creates an empty tFoot element in a table Yes
createTHead() Creates an empty tHead element in a table Yes
deleteCaption() Deletes the caption element and its content from a table Yes
deleteRow() Deletes a row from a table Yes
deleteTFoot() Deletes the tFoot element and its content from a table Yes
deleteTHead() Deletes the tHead element and its content from a table Yes
insertRow() Inserts a new row in a table Yes
standard properties, Methods, and events
The Table object also supports the standard properties, methods, and events.
Tablecell Object
The TableCell object represents an HTML table cell.
For each <td> tag in an HTML document, a TableCell object is created.
Tablecell Object properties
W3C: W3C Standard.
property description W3c
abbr Sets or returns an abbreviated version of the content in a table cell Yes
align Sets or returns the horizontal alignment of data within a table cell Yes
axis Sets or returns a comma-delimited list of related table cells Yes
cellIndex Returns the position of a cell in the cells collection of a row Yes
ch Sets or returns the alignment character for a table cell Yes
chOff Sets or returns the offset of alignment character for a table cell Yes
colSpan Sets or returns the number of columns a table cell should span Yes
headers Sets or returns a list of space-separated header-cell ids Yes
rowSpan Sets or returns the number of rows a table cell should span Yes
scope Sets or returns if this cell provides header information Yes
vAlign Sets or returns the vertical alignment of data within a table cell Yes
width Sets or returns the width of a table cell Yes
standard properties, Methods, and events
The TableCell object also supports the standard properties, methods, and events.
Appendix B: HTML dOM Objects
243
TableRow Object
The TableRow object represents an HTML table row.
For each <tr> tag in an HTML document, a TableRow object is created.
TableRow Object collections
W3C: W3C Standard.
collection description W3c
cells[] Returns an array containing each cell in the table row Yes
TableRow Object properties
property description W3c
align Sets or returns the horizontal alignment of data within a table
row
Yes
ch Sets or returns the alignment character for cells in a table row Yes
chOff Sets or returns the offset of alignment character for the cells in
a table row
Yes
rowIndex Returns the position of a row in the table’s rows collection Yes
sectionRowIndex Returns the position of a row in the tBody, tHead, or tFoot rows
collection
Yes
vAlign Sets or returns the vertical alignment of data within a table row Yes
TableRow Object Methods
Method description W3c
deleteCell() Deletes a cell in a table row Yes
insertCell() Inserts a cell in a table row Yes
standard properties, Methods, and events
The TableRow object also supports the standard properties, methods, and events.
Textarea Object
The Textarea object represents a text-area in an HTML form.
For each <textarea> tag in an HTML form, a Textarea object is created.
You can access a Textarea object by indexing the elements array (by number or
name) of the form or by using getElementById().
❑ Event Object
❑ Element Object
❑ Anchor Object
❑ Area Object
❑ Base Object
❑ Body Object
❑ Button Object (Push Button)
❑ Form Object
❑ Frame/IFrame Object
❑ Frameset Object
❑ Image Object
❑ Button Object
❑ Checkbox Object
❑ FileUpload Object
❑ Hidden Object
❑ Password Object
❑ Radio Object
❑ Reset Object
❑ Submit Object
❑ Text Object
❑ Link Object
❑ Meta Object
❑ Object Object
❑ Option Object
❑ Select Object
❑ Style Object
❑ Table Object
❑ TableCell Object
❑ TableRow Object
❑ Textarea Object
The World Wide Web Consortium (W3C) is an international community that
develops standards to ensure the long-term growth of the Web. The W3C DOM
page is located at http://www.w3.org/DOM/.
document Object
Each HTML document loaded into a browser window becomes a Document
object.
The Document object provides access to all HTML elements in a page, from within
a script.
document Object collections
anchors[] Returns an array of all the anchors in the document Yes
forms[] Returns an array of all the forms in the document Yes
images[] Returns an array of all the images in the document Yes
links[] Returns an array of all the links in the document Yes
The Document object is also part of the Window object and can be accessed
through the window.documentproperty.
Ti p
Learn javascript and Ajax with w3schools
216
document Object properties
property description W3c
cookie Returns all name/value pairs of cookies in the document Yes
documentMode
Returns the mode used by the browser to render the docu-ment
No
domain
Returns the domain name of the server that loaded the docu-ment
Yes
lastModified Returns the date and time the document was last modified No
readyState Returns the (loading) status of the document No
referrer
Returns the URL of the document that loaded the current
document
Yes
title Sets or returns the title of the document Yes
URL Returns the full URL of the document Yes
document Object Methods
Method description W3c
close()
Closes the output stream previously opened with
document.open()
Yes
getElementById() Accesses the first element with the specified id Yes
getElementsByName() Accesses all elements with a specified name Yes
getElementsByTagName() Accesses all elements with a specified tagname Yes
open()
Opens an output stream to collect the output from
document.write() or document.writeln()
Yes
write()
Writes HTML expressions or JavaScript code to a
document
Yes
writeln()
Same as write(), but adds a newline character after
each statement
Yes
event Object
The Event object gives you information about an event that has occurred.
The Event object represents the state of an event, such as the element in which the
event occurred, the state of the keyboard keys, the location of the mouse, and the
state of the mouse buttons.
Events are normally used in combination with functions, and the function will not
be executed before the event occurs!
event Handlers
New to HTML 4.0 was the ability to let HTML events trigger actions in the
browser, like starting a JavaScript when a user clicks on an HTML element. Follow-ing is a list of the attributes that can be inserted into HTML tags to define event
actions.
IE: Internet Explorer; F: Firefox; O: Opera; W3C: W3C Standard.
Attribute The event occurs when... ie F O W3c
onblur An element loses focus 3 1 9 Yes
onchange The content of a field changes 3 1 9 Yes
onclick Mouse clicks an object 3 1 9 Yes
ondblclick Mouse double-clicks an object 4 1 9 Yes
onerror
An error occurs when loading a document or an
image
4 1 9 Yes
onfocus An element gets focus 3 1 9 Yes
onkeydown A keyboard key is pressed 3 1 NoYes
onkeypress A keyboard key is pressed or held down 3 1 9 Yes
onkeyup A keyboard key is released 3 1 9 Yes
onload A page or an image is finished loading 3 1 9 Yes
onmousedown A mouse button is pressed 4 1 9 Yes
onmousemove The mouse is moved 3 1 9 Yes
onmouseout The mouse is moved off an element 4 1 9 Yes
onmouseover The mouse is moved over an element 3 1 9 Yes
onmouseup A mouse button is released 4 1 9 Yes
onresize A window or frame is resized 4 1 9 Yes
onselect Text is selected 3 1 9 Yes
onunload The user exits the page 3 1 9 Yes
Mouse / Keyboard Attributes
property description ie F O W3c
altKey
Returns whether the Alt key was pressed when an
event was triggered
6 1 9 Yes
button
Returns which mouse button was clicked when an
event was triggered
6 1 9 Yes
clientX
Returns the horizontal coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
clientY
Returns the vertical coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
ctrlKey
Returns whether the Ctrl key was pressed when an
event was triggered
6 1 9 Yes
metaKey
Returns whether the meta key was pressed when
an event was triggered
6 1 9 Yes
relatedTarget
Returns the element related to the element that
triggered the event
No 1 9 Yes
screenX
Returns the horizontal coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
screenY
Returns the vertical coordinate of the mouse
pointer when an event was triggered
6 1 9 Yes
shiftKey
Returns whether the Shift key was pressed when an
event was triggered
6 1 9 Yes
Learn javascript and Ajax with w3schools
218
Other event Attributes
property description ie F O W3c
bubbles
Returns a Boolean value that indicates whether an
event is a bubbling event
No 1 9 Yes
cancelable
Returns a Boolean value that indicates whether an
event can have its default action prevented
No 1 9 Yes
currentTarget
Returns the element whose event listeners trig-gered the event
No 1 9 Yes
eventPhase
Returns which phase of the event flow is currently
being evaluated
Yes
target Returns the element that triggered the event No 1 9 Yes
timeStamp
Returns the time stamp, in milliseconds, from the
epoch (system start or event trigger)
No 1 9 Yes
type Returns the name of the event 6 1 9 Yes
element Object
The collections, properties, methods, and events in the following tables can be used
on all HTML elements.
element Object collections
W3C: W3C Standard.
collection description W3c
attributes[] Returns an array of the attributes of an element Yes
childNodes[] Returns an array of child nodes for an element Yes
element Object properties
property description W3c
accessKey Sets or returns an accesskey for an element Yes
className Sets or returns the class attribute of an element Yes
clientHeight
Returns the viewable height of the content on a page (not
including borders, margins, or scrollbars)
Yes
clientWidth
Returns the viewable width of the content on a page (not
including borders, margins, or scrollbars)
Yes
dir Sets or returns the text direction of an element Yes
disabled Sets or returns the disabled attribute of an element Yes
firstChild Returns the first child of an element Yes
height Sets or returns the height attribute of an element Yes
id Sets or returns the id of an element Yes
innerHTML Sets or returns the HTML contents (+text) of an element Yes
lang Sets or returns the language code for an element Yes
Appendix B: HTML dOM Objects
219
property description W3c
lastChild Returns the last child of an element Yes
length Does not apply to all objects. See specific object type. Yes
nextSibling Returns the element immediately following an element Yes
nodeName Returns the tagname of an element (in uppercase) Yes
nodeType Returns the type of the element Yes
nodeValue Returns the value of the element Yes
offsetHeight
Returns the height of an element, including borders and pad-ding if any, but not margins
No
offsetLeft
Returns the horizontal offset position of the current element
relative to its offset container
Yes
offsetParent Returns the offset container of an element Yes
offsetTop
Returns the vertical offset position of the current element
relative to its offset container
Yes
offsetWidth
Returns the width of an element, including borders and pad-ding if any, but not margins
No
ownerDocument Returns the root element (document object) for an element Yes
parentNode Returns the parent node of an element Yes
previousSibling Returns the element immediately before an element Yes
scrollHeight
Returns the entire height of an element (including areas hid-den with scrollbars)
Yes
scrollLeft
Returns the distance between the actual left edge of an ele-ment and its left edge currently in view
Yes
scrollTop
Returns the distance between the actual top edge of an ele-ment and its top edge currently in view
Yes
scrollWidth
Returns the entire width of an element (including areas hid-den with scrollbars)
Yes
style Sets or returns the style attribute of an element Yes
tabIndex Sets or returns the tab order of an element Yes
tagName Returns the tagname of an element as a string (in uppercase) Yes
title Sets or returns the title attribute of an element Yes
width Sets or returns the width attribute of an element Yes
appendChild() Adds a new child element to the end of the list of
children of the element
Yes
blur() Removes focus from an element Yes
click() Executes a click on an element Yes
cloneNode() Clones an element Yes
focus() Gives focus to an element Yes
getAttribute() Returns the value of an attribute Yes
getElementsByTagName() Accesses all elements with a specified tagname Yes
(continued)
hasChildNodes() Returns whether an element has any child elements Yes
insertBefore() Inserts a new child element before an existing child
element
Yes
item() Returns an element based on its index within the
document tree
Yes
normalize() Puts all text nodes underneath this element (including
attributes) into a “normal” form where only structure
(for example, elements, comments, processing instruc-tions, CDATA sections, and entity references) separates
Text nodes, that is, there are neither adjacent Text
nodes nor empty Text nodes
Yes
removeAttribute() Removes a specified attribute from an element Yes
removeChild() Removes a child element Yes
replaceChild() Replaces a child element Yes
setAttribute() Adds a new attribute to an element Yes
toString() Converts an element to a string Yes
element Object events
event description W3c
onblur When an element loses focus Yes
onclick When a mouse clicks on an element Yes
ondblclick When a mouse double-clicks on an element Yes
onfocus When an element gets focus Yes
onkeydown When a keyboard key is pressed Yes
onkeypress When a keyboard key is pressed or held down Yes
onkeyup When a keyboard key is released Yes
onmousedown When a mouse button is pressed Yes
onmousemove When the mouse is moved Yes
onmouseout When the mouse cursor leaves an element Yes
onmouseover When the mouse cursor enters an element Yes
onmouseup When a mouse button is released Yes
onresize When an element is resized Yes
Anchor Object
The Anchor object represents an HTML hyperlink.
For each <a> tag in an HTML document, an Anchor object is created.
An anchor allows you to create a link to another document (with the href attri-bute) or to a different point in the same document (with the name attribute).
You can access an anchor by using getElementById() or by searching through
the anchors[] array of the Document object.
(continued)
charset Sets or returns the value of the charset attribute of a link Yes
href Sets or returns the value of the href attribute of a link Yes
hreflang Sets or returns the value of the hreflang attribute of a link Yes
name Sets or returns the value of the name attribute of a link Yes
rel Sets or returns the value of the rel attribute of a link Yes
rev Sets or returns the value of the rev attribute of a link Yes
target Sets or returns the value of the target attribute of a link Yes
type Sets or returns the value of the type attribute of a link Yes
standard properties, Methods, and events
The Anchor object also supports the standard properties, methods, and events.
Area Object
The Area object represents an area inside an HTML image map (an image map is
an image with clickable areas).
For each <area> tag in an HTML document, an Area object is created.
Area Object properties
alt Sets or returns the value of the alt attribute of an area Yes
coords Sets or returns the value of the coords attribute of an area Yes
hash Sets or returns the anchor part of the href attribute value Yes
host Sets or returns the hostname:port part of the href attribute value Yes
hostname Sets or returns the hostname part of the href attribute value Yes
href Sets or returns the value of the href attribute of an area Yes
noHref Sets or returns the value of the nohref attribute of an area Yes
pathname Sets or returns the pathname part of the href attribute value Yes
port Sets or returns the port part of the href attribute value Yes
protocol Sets or returns the protocol part of the href attribute value Yes
search Sets or returns the querystring part of the href attribute value Yes
shape Sets or returns the value of the shape attribute of an area Yes
target Sets or returns the value of the target attribute of an area Yes
standard properties, Methods, and events
The Area object also supports the standard properties, methods, and events.
Base Object
The Base object represents an HTML base element.
The base element is used to specify a default address or a default target for all links
on a page.
For each <base> tag in an HTML document, a Base object is created.
Base Object properties
href Sets or returns the value of the href attribute in a base element Yes
target Sets or returns the value of the target attribute in a base element Yes
standard properties, Methods, and events
The Base object also supports the standard properties, methods, and events.
Body Object
The Body object represents the HTML body element.
The Body element defines a document’s body.
The Body element contains all the contents of an HTML document, such as text,
hyperlinks, images, tables, lists, and so on.
Body Object properties
aLink Sets or returns the value of the alink attribute of the body element Yes
background
Sets or returns the value of the background attribute of the body
element
Yes
bgColor Sets or returns the value of the bgcolor attribute of the body element Yes
link Sets or returns the value of the link attribute of the body element Yes
text Sets or returns the value of the text attribute of the body element Yes
vLink Sets or returns the value of the vlink attribute of the body element Yes
standard properties, Methods, and events
The Body object also supports the standard properties, methods, and events.
Button Object (push Button)
The Button object represents a Button Object (Push Button).
For each <button> tag in an HTML document, a Button object is created.
Inside an HTML Button element you can put content like text or images. This is
the difference between this element and buttons created with the input element.
Button Object properties
\
form Returns a reference to the form that contains a button Yes
name Sets or returns the value of the name attribute of a button Yes
type Sets or returns the type of a button Yes
value Sets or returns the value of the value attribute of a button Yes
standard properties, Methods, and events
The Button object also supports the standard properties, methods, and events.
Form Object
The Form object represents an HTML form.
For each <form> tag in an HTML document, a Form object is created.
Forms are used to collect user input and contain input elements like text fields,
check boxes, radio buttons, Submit buttons, and more. A form also can contain
select menus and textarea, fieldset, legend, and label elements.
Forms are used to pass data to a server.
elements[] Returns an array of all elements in a form Yes
acceptCharset Sets or returns the value of the accept-charset attribute in a form Yes
action Sets or returns the value of the action attribute in a form Yes
enctype Sets or returns the value of the enctype attribute in a form Yes
length Returns the number of elements in a form Yes
method Sets or returns the value of the method attribute in a form Yes
name Sets or returns the value of the name attribute in a form Yes
target Sets or returns the value of the target attribute in a form Yes
\
reset() Resets a form Yes
submit() Submits a form Yes
Form Object events
event The event occurs when... W3c
onreset The Reset button is clicked Yes
onsubmit The Submit button is clicked Yes
standard properties, Methods, and events
The Form object also supports the standard properties, methods, and events.
Frame/iFrame Object
The Frame object represents an HTML frame.
The <frame> tag defines one particular window (frame) within a frameset.
For each <frame> tag in an HTML document, a Frame object is created.
The IFrame object represents an HTML inline frame.
The <iframe> tag defines an inline frame that contains another document.
For each <iframe> tag in an HTML document, an IFrame object is created.
align Sets or returns the value of the align attribute in an iframe Yes
contentDocument Returns the document object generated by a frame/iframe Yes
contentWindow Returns the window object generated by a frame/iframe No
frameBorder
Sets or returns the value of the frameborder attribute in a
frame/iframe
Yes
height Sets or returns the value of the height attribute in an iframe Yes
longDesc
Sets or returns the value of the longdesc attribute in a frame/
iframe
Yes
marginHeight
Sets or returns the value of the marginheight attribute in a
frame/iframe
Yes
marginWidth
Sets or returns the value of the marginwidth attribute in a
frame/iframe
Yes
name
Sets or returns the value of the name attribute in a frame/
iframe
Yes
noResize Sets or returns the value of the noresize attribute in a frame Yes
scrolling
Sets or returns the value of the scrolling attribute in a frame/
iframe
Yes
src Sets or returns the value of the src attribute in a frame/iframe Yes
width Sets or returns the value of the width attribute in an iframe Yes
standard properties, Methods, and events
The Frame and IFrame objects also support the standard properties, methods, and
events.
Frameset Object
The Frameset object represents an HTML frameset.
The HTML frameset element holds two or more frame elements. Each frame ele-ment holds a separate document.
The HTML frameset element states only how many columns or rows there will be
in the frameset.
Frameset Object properties
border Sets or returns the width of the border between frames Yes
cols Sets or returns the value of the cols attribute in a frameset Yes
rows Sets or returns the value of the rows attribute in a frameset Yes
onload Script to be run when a document loads Yes
standard properties, Methods, and events
The Frameset object also supports the standard properties, methods, and events.
image Object
The Image object represents an embedded image.
For each <img> tag in an HTML document, an Image object is created.
image Object properties
align Sets or returns how to align an image according to the surrounding
text
Yes
alt Sets or returns an alternate text to be displayed if a browser cannot
show an image
Yes
border Sets or returns the border around an image Yes
complete Returns whether the browser has finished loading the image No
height Sets or returns the height of an image Yes
href
hspace Sets or returns the white space on the left and right side of the image Yes
isMap Returns whether an image is a server-side image map Yes
longDesc Sets or returns a URL to a document containing a description of the
image
Yes
lowsrc Sets or returns a URL to a low-resolution version of an image No
name Sets or returns the name of an image Yes
src Sets or returns the URL of an image Yes
useMap Sets or returns the value of the usemap attribute of a client-side im-age map
Yes
vspace Sets or returns the white space on the top and bottom of the image Yes
width Sets or returns the width of an image Yes
onabort Loading of an image is interrupted Yes
onerror An error occurs when loading an image Yes
onload An image is finished loading Yes
standard properties, Methods, and events
The Image object also supports the standard properties, methods, and events.
Button Object
The Button object represents a button in an HTML form.
For each instance of an <input type="button"> tag in an HTML form, a
Button object is created.
You can access a button by searching through the elements[] array of the form or
by using document.getElementById().
Button Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port buttons
Yes
disabled Sets or returns whether a button should be disabled Yes
form Returns a reference to the form that contains the button Yes
name Sets or returns the name of a button Yes
type Returns the type of form element a button is Yes
value Sets or returns the text that is displayed on the button Yes
standard properties, Methods, and events
The Button object also supports the standard properties, methods, and events.
checkbox Object
The Checkbox object represents a check box in an HTML form.
For each <input type="checkbox"> tag in an HTML form, a Checkbox object
is created.
You can access a check box by searching through the elements[] array of the
form, or by using document.getElementById().
Learn javascript and Ajax with w3schools
alt Sets or returns an alternate text to display if a browser does not
support check boxes
Yes
checked Sets or returns whether a check box should be checked Yes
defaultChecked Returns the default value of the checked attribute Yes
disabled Sets or returns whether a check box should be disabled Yes
form Returns a reference to the form that contains the check box Yes
name Sets or returns the name of a check box Yes
type Returns the type of form element a check box is Yes
value Sets or returns the value of the value attribute of a check box Yes
standard properties, Methods, and events
The Checkbox object also supports the standard properties, methods, and events.
FileUpload Object
For each <input type="file"> tag in an HTML form, a FileUpload object is
created.
You can access a FileUpload object by searching through the elements[] array of
the form or by using document.getElementById().
FileUpload Object properties
accept Sets or returns a comma-separated list of MIME types that indicates
the MIME type of the file transfer
Yes
alt Sets or returns an alternate text to display if the browser does not
support <input type=”file”>
Yes
defaultValue Sets or returns the initial value of the FileUpload object Yes
disabled Sets or returns whether the FileUpload object should be disabled Yes
form Returns a reference to the form that contains the FileUpload object Yes
name Sets or returns the name of the FileUpload object Yes
type Returns the type of the form element. For a FileUpload object it will
be “file”
Yes
value Returns the filename of the FileUpload object after the text is set by
user input
Yes
select() Selects the FileUpload object Yes
standard properties, Methods, and events
The FileUpload object also supports the standard properties, methods, and events.
Hidden Object
The Hidden object represents a hidden input field in an HTML form.
For each <input type="hidden"> tag in an HTML form, a Hidden object is
created.
You can access a hidden input field by searching through the elements[] array of
the form, or by using document.getElementById().
Hidden Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port hidden fields
Yes
form Returns a reference to the form that contains the hidden field Yes
name Sets or returns the name of a hidden field Yes
type Returns the type of form element a hidden input field is Yes
value Sets or returns the value of the value attribute of the hidden field Yes
standard properties, Methods, and events
The Hidden object also supports the standard properties, methods, and events.
password Object
The Password object represents a password field in an HTML form.
For each <input type="password"> tag in an HTML form, a Password object
is created.
You can access a password field by searching through the elements[] array of the
form or by using document.getElementById().
alt Sets or returns an alternate text to display if a browser does not sup-port password fields
Yes
defaultValue Sets or returns the default value of a password field Yes
disabled Sets or returns whether a password field should be disabled Yes
form Returns a reference to the form that contains the password field Yes
maxLength Sets or returns the maximum number of characters in a password
field
Yes
name Sets or returns the name of a password field Yes
readOnly Sets or returns whether a password field should be read-only Yes
size Sets or returns the size of a password field Yes
type Returns the type of form element a password field is Yes
value Sets or returns the value of the value attribute of the password field Yes
password Object Methods
Method description W3c
select() Selects the text in a password field Yes
standard properties, Methods, and events
The Password object also supports the standard properties, methods, and events.
Radio Object
The Radio object represents a radio button in an HTML form.
For each <input type="radio"> tag in an HTML form, a Radio object is
created.
You can access a Radio object by searching through the elements[] array of the
form or by using document.getElementById().
Radio Object properties
W3C: W3C Standard.
property description W3c
alt Sets or returns an alternate text to display if a browser does not
support radio buttons
Yes
checked Sets or returns the state of a radio button Yes
defaultChecked Returns the default state of a radio button Yes
disabled Sets or returns whether a radio button should be disabled Yes
form Returns a reference to the form that contains the radio button Yes
name Sets or returns the name of a radio button Yes
type Returns the type of form element a radio button is Yes
value Sets or returns the value of the value attribute of the radio button Yes
standard properties, Methods, and events
The Radio object also supports the standard properties, methods, and events.
Reset Object
The Reset object represents a reset button in an HTML form.
For each <input type="reset"> tag in an HTML form, a Reset object is
created.
You can access a reset button by searching through the elements[] array of the
form or by using document.getElementById().
Reset Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port reset buttons
Yes
disabled Sets or returns whether a reset button should be disabled Yes
form Returns a reference to the form that contains the reset button Yes
name Sets or returns the name of a reset button Yes
type Returns the type of form element a reset button is Yes
value Sets or returns the text that is displayed on a reset button Yes
standard properties, Methods, and events
The Reset object also supports the standard properties, methods, and events.
submit Object
The Submit object represents a submit button in an HTML form.
For each <input type="submit"> tag in an HTML form, a Submit object is
created.
You can access a submit button by searching through the elements[] array of the
form or by using document.getElementById().
submit Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port submit buttons
Yes
disabled Sets or returns whether a submit button should be disabled Yes
form Returns a reference to the form that contains the submit button Yes
name Sets or returns the name of a submit button Yes
type Returns the type of form element a submit button is Yes
value Sets or returns the text that is displayed on a submit button Yes
standard properties, Methods, and events
The Submit object also supports the standard properties, methods, and events.
Text Object
The Text object represents a text-input field in an HTML form.
For each <input type="text"> tag in an HTML form, a Text object is created.
You can access a text-input field by searching through the elements[] array of the
form, or by using document.getElementById().
Text Object properties
alt Sets or returns an alternate text to display if a browser does not sup-port text fields
Yes
defaultValue Sets or returns the default value of a text field Yes
disabled Sets or returns whether a text field should be disabled Yes
form Returns a reference to the form that contains the text field Yes
maxLength Sets or returns the maximum number of characters in a text field Yes
name Sets or returns the name of a text field Yes
readOnly Sets or returns whether a text field should be read-only Yes
size Sets or returns the size of a text field Yes
type Returns the type of form element a text field is Yes
value Sets or returns the value of the value attribute of a text field Yes
\
select() Selects the content of a text field Yes
standard properties, Methods, and events
The Text object also supports the standard properties, methods, and events.
Link Object
The Link object represents an HTML link element.
A link element defines the relationship between two linked documents.
The link element is defined in the head section of an HTML document.
Link Object properties
charset Sets or returns the character encoding of the target URL Yes
disabled Sets or returns whether the target URL should be disabled Yes
href Sets or returns the URL of a linked resource Yes
hreflang Sets or returns the base language of the target URL Yes
media Sets or returns on what device the document will be displayed Yes
name Sets or returns the name of a <link> element Yes
rel Sets or returns the relationship between the current document and
the target URL
Yes
rev Sets or returns the relationship between the target URL and the cur-rent document
Yes
type Sets or returns the MIME type of the target URL Yes
standard properties, Methods, and events
The Link object also supports the standard properties, methods, and events.
Meta Object
The Meta object represents an HTML meta element.
Metadata is information about data.
The <meta> tag provides metadata about the HTML document. Metadata will not
be displayed on the page, but will be machine parsable.
Meta elements are typically used to specify page description, keywords, author of
the document, last modified, and other metadata.
The <meta> tag always goes inside the head element.
Meta Object properties
W3C: W3C Standard.
property description W3c
content Sets or returns the value of the content attribute of a <meta>
element
Yes
httpEquiv Connects the content attribute to an HTTP header Yes
name Connects the content attribute to a name Yes
scheme Sets or returns the format to be used to interpret the value of the
content attribute
Yes
standard properties, Methods, and events
The Meta object also supports the standard properties, methods, and events.
Object Object
The Object object represents an HTML object element.
The <object> tag is used to include objects such as images, audio, videos, Java
applets, ActiveX, PDF, and Flash into a Web page.
Object Object properties
align Sets or returns the alignment of the object according to the sur-rounding text
Yes
archive Sets or returns a string that can be used to implement your own
archive functionality for the object
Yes
border Sets or returns the border around the object Yes
code Sets or returns the URL of the file that contains the compiled Java
class
Yes
codeBase Sets or returns the URL of the component Yes
codeType Sets or retrieves the Internet media type for the code associated with
the object. Read only.
Yes
data A URL specifying the location of the object’s data Yes
declare Declare (for future reference), but do not instantiate, this object Yes
form Returns a reference to the object’s parent form Yes
height Sets or returns the height of the object Yes
hspace Sets or returns the horizontal margin of the object Yes
name Sets or returns the name of the object Yes
standby Sets or returns a message when loading the object Yes
type Sets or returns the content type for data downloaded via the data
attribute
Yes
useMap Use client-side image map Yes
vspace Sets or returns the vertical margin of the object Yes
width Sets or returns the width of the object Yes
standard properties, Methods, and events
The Object object also supports the standard properties, methods, and events.
Option Object
The Option object represents an option in a drop-down list in an HTML form.
For each <option> tag in an HTML form, an Option object is created.
You can access an Option object by searching through the elements[] array of the
form, or by using document.getElementById().
Option Object properties
defaultSelected Returns the default value of the selected attribute Yes
disabled Sets or returns whether an option should be disabled Yes
form Returns a reference to the form that contains an option Yes
index Returns the index position of an option in a drop-down list Yes
label Sets or returns a label for an option (only for option-groups) Yes
selected Sets or returns the value of the selected attribute Yes
text Sets or returns the text value of an option Yes
value Sets or returns the value to be sent to the server Yes
standard properties, Methods, and events
The Option object also supports the standard properties, methods, and events.
select Object
The Select object represents a drop-down list in an HTML form.
For each <select> tag in an HTML form, a Select object is created.
You can access a Select object by searching through the elements[] array of the
form or by using document.getElementById().
select Object collections
options[] Returns an array of all the options in a drop-down list Yes
select Object properties
property description W3c
disabled Sets or returns whether a drop-down list should be disabled Yes
form Returns a reference to the form that contains the drop-down list Yes
length Returns the number of options in a drop-down list Yes
multiple Sets or returns whether multiple items can be selected Yes
name Sets or returns the name of a drop-down list Yes
selectedIndex Sets or returns the index of the selected option in a drop-down
list
Yes
size Sets or returns the number of visible rows in a drop-down list Yes
type Returns the type of form element a drop-down list is Yes
select Object Methods
Method description W3c
add() Adds an option to a drop-down list Yes
remove() Removes an option from a drop-down list Yes
standard properties, Methods, and events
The Select object also supports the standard properties, methods, and events.
style Object
The Style object represents an individual style statement.
The Style object can be accessed from the document or from the elements to which
that style is applied.
Syntax for using the Style object properties:
document.getElementById("id").style.property="value"
The Style object property categories are as follows:
8 Background
8 Border and Margin
8 Layout
8 List
8 Misc
8 Positioning
8 Printing
8 Table
8 Text
Background properties
background Sets all background properties Yes
backgroundAttachment Sets whether a background-image is fixed or scrolls
with the page
Yes
backgroundColor Sets the background-color of an element Yes
backgroundImage Sets the background-image of an element Yes
backgroundPosition Sets the starting position of a background-image Yes
backgroundPositionX Sets the x-coordinates of the backgroundPosition
property
No
backgroundPositionY Sets the y-coordinates of the backgroundPosition
property
No
backgroundRepeat Sets if/how a background-image will be repeated Yes
Border and Margin properties
property description W3c
border Sets all properties for the four borders Yes
borderBottom Sets all properties for the bottom border Yes
borderBottomColor Sets the color of the bottom border Yes
borderBottomStyle Sets the style of the bottom border Yes
borderBottomWidth Sets the width of the bottom border Yes
(continued)
borderColor Sets the color of all four borders (can have up to four colors) Yes
borderLeft Sets all properties for the left border Yes
borderLeftColor Sets the color of the left border Yes
borderLeftStyle Sets the style of the left border Yes
borderLeftWidth Sets the width of the left border Yes
borderRight Sets all properties for the right border Yes
borderRightColor Sets the color of the right border Yes
borderRightStyle Sets the style of the right border Yes
borderRightWidth Sets the width of the right border Yes
borderStyle Sets the style of all four borders (can have up to four styles) Yes
borderTop Sets all properties for the top border Yes
borderTopColor Sets the color of the top border Yes
borderTopStyle Sets the style of the top border Yes
borderTopWidth Sets the width of the top border Yes
borderWidth Sets the width of all four borders (can have up to four
widths)
Yes
margin Sets the margins of an element (can have up to four values) Yes
marginBottom Sets the bottom margin of an element Yes
marginLeft Sets the left margin of an element Yes
marginRight Sets the right margin of an element Yes
marginTop Sets the top margin of an element Yes
outline Sets all outline properties Yes
outlineColor Sets the color of the outline around a element Yes
outlineStyle Sets the style of the outline around an element Yes
outlineWidth Sets the width of the outline around an element Yes
padding Sets the padding of an element (can have up to four values) Yes
paddingBottom Sets the bottom padding of an element Yes
paddingLeft Sets the left padding of an element Yes
paddingRight Sets the right padding of an element Yes
paddingTop Sets the top padding of an element Yes
Layout properties
property description W3c
clear Sets on which sides of an element other floating elements
are not allowed
Yes
clip Sets the shape of an element Yes
content Sets meta-information Yes
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
Yes
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
Yes
(continued)
cssFloat Sets where an image or a text will appear (float) in another
element
Yes
cursor Sets the type of cursor to be displayed Yes
direction Sets the text direction of an element Yes
display Sets how an element will be displayed Yes
height Sets the height of an element Yes
markerOffset Sets the distance between the nearest border edges of a
marker box and its principal box
Yes
marks Sets whether cross marks or crop marks should be rendered
just outside the page box edge
Yes
maxHeight Sets the maximum height of an element Yes
maxWidth Sets the maximum width of an element Yes
minHeight Sets the minimum height of an element Yes
minWidth Sets the minimum width of an element Yes
overflow Specifies what to do with content that does not fit in an
element box
Yes
verticalAlign Sets the vertical alignment of content in an element Yes
visibility Sets whether an element should be visible Yes
width Sets the width of an element Yes
listStyle Sets all the properties for a list Yes
listStyleImage Sets an image as the list-item marker Yes
listStylePosition Positions the list-item marker Yes
listStyleType Sets the list-item marker type Yes
Misc properties
property description W3c
cssText Contains the entire contents of the stylesheet. ieonly
property
positioning properties
property description W3c
bottom Sets how far the bottom edge of an element is above/be-low the bottom edge of the parent element
Yes
left Sets how far the left edge of an element is to the right/left
of the left edge of the parent element
Yes
position Places an element in a static, relative, absolute, or fixed posi-tion
Yes
(continued)
right Sets how far the right edge of an element is to the left/right
of the right edge of the parent element
Yes
top Sets how far the top edge of an element is above/below the
top edge of the parent element
Yes
zIndex Sets the stack order of an element Yes
printing properties
property description W3c
orphans Sets the minimum number of lines for a paragraph that
must be left at the bottom of a page
Yes
page Sets a page type to use when displaying an element Yes
pageBreakAfter Sets the page-breaking behavior after an element Yes
pageBreakBefore Sets the page-breaking behavior before an element Yes
pageBreakInside Sets the page-breaking behavior inside an element Yes
size Sets the orientation and size of a page Yes
widows Sets the minimum number of lines for a paragraph that
must be left at the top of a page
Yes
Table properties
property description W3c
borderCollapse Sets whether the table borders are collapsed into a single
border or detached as in standard HTML
Yes
borderSpacing Sets the distance that separates cell borders Yes
captionSide Sets the position of the table caption Yes
emptyCells Sets whether to show empty cells in a table Yes
tableLayout Sets the algorithm used to display the table cells, rows, and
columns
Yes
Text properties
property description W3c
color Sets the color of the text Yes
font Sets all font properties Yes
fontFamily Sets the font of an element Yes
fontSize Sets the font-size of an element Yes
fontSizeAdjust Sets/adjusts the size of text Yes
fontStretch Sets how to condense or stretch a font Yes
fontStyle Sets the font-style of an element Yes
fontVariant Displays text in a small-caps font Yes
fontWeight Sets the boldness of the font Yes
letterSpacing Sets the space between characters Yes
lineHeight Sets the distance between lines Yes
(continued)
quotes Sets which quotation marks to use in text Yes
textAlign Aligns the text Yes
textDecoration Sets the decoration of text Yes
textIndent Indents the first line of text Yes
textShadow Sets the shadow effect of text Yes
textTransform Sets capitalization effect on text Yes
unicodeBidi Sets the Unicode bidirectional property Yes
whiteSpace Sets how to handle line breaks and white space in text Yes
wordSpacing Sets the space between words in a text Yes
Table Object
The Table object represents an HTML table.
For each <table> tag in an HTML document, a Table object is created.
Table Object collections
W3C: W3C Standard.
collection description W3c
cells[] Returns an array containing each cell in a table No
rows[] Returns an array containing each row in a table Yes
tBodies[] Returns an array containing each tbody in a table Yes
Table Object properties
property description W3c
border Sets or returns the width of the table border Yes
caption Sets or returns the caption of a table Yes
cellPadding Sets or returns the amount of space between the cell border and cell
content
Yes
cellSpacing Sets or returns the amount of space between the cells in a table Yes
frame Sets or returns the outer borders of a table Yes
rules Sets or returns the inner borders of a table Yes
summary Sets or returns a description of a table Yes
tFoot Returns the tFoot object of a table Yes
tHead Returns the tHead object of a table Yes
width Sets or returns the width of a table Yes
createCaption() Creates a caption element for a table Yes
createTFoot() Creates an empty tFoot element in a table Yes
createTHead() Creates an empty tHead element in a table Yes
deleteCaption() Deletes the caption element and its content from a table Yes
deleteRow() Deletes a row from a table Yes
deleteTFoot() Deletes the tFoot element and its content from a table Yes
deleteTHead() Deletes the tHead element and its content from a table Yes
insertRow() Inserts a new row in a table Yes
standard properties, Methods, and events
The Table object also supports the standard properties, methods, and events.
Tablecell Object
The TableCell object represents an HTML table cell.
For each <td> tag in an HTML document, a TableCell object is created.
Tablecell Object properties
W3C: W3C Standard.
property description W3c
abbr Sets or returns an abbreviated version of the content in a table cell Yes
align Sets or returns the horizontal alignment of data within a table cell Yes
axis Sets or returns a comma-delimited list of related table cells Yes
cellIndex Returns the position of a cell in the cells collection of a row Yes
ch Sets or returns the alignment character for a table cell Yes
chOff Sets or returns the offset of alignment character for a table cell Yes
colSpan Sets or returns the number of columns a table cell should span Yes
headers Sets or returns a list of space-separated header-cell ids Yes
rowSpan Sets or returns the number of rows a table cell should span Yes
scope Sets or returns if this cell provides header information Yes
vAlign Sets or returns the vertical alignment of data within a table cell Yes
width Sets or returns the width of a table cell Yes
standard properties, Methods, and events
The TableCell object also supports the standard properties, methods, and events.
Appendix B: HTML dOM Objects
243
TableRow Object
The TableRow object represents an HTML table row.
For each <tr> tag in an HTML document, a TableRow object is created.
TableRow Object collections
W3C: W3C Standard.
collection description W3c
cells[] Returns an array containing each cell in the table row Yes
TableRow Object properties
property description W3c
align Sets or returns the horizontal alignment of data within a table
row
Yes
ch Sets or returns the alignment character for cells in a table row Yes
chOff Sets or returns the offset of alignment character for the cells in
a table row
Yes
rowIndex Returns the position of a row in the table’s rows collection Yes
sectionRowIndex Returns the position of a row in the tBody, tHead, or tFoot rows
collection
Yes
vAlign Sets or returns the vertical alignment of data within a table row Yes
TableRow Object Methods
Method description W3c
deleteCell() Deletes a cell in a table row Yes
insertCell() Inserts a cell in a table row Yes
standard properties, Methods, and events
The TableRow object also supports the standard properties, methods, and events.
Textarea Object
The Textarea object represents a text-area in an HTML form.
For each <textarea> tag in an HTML form, a Textarea object is created.
You can access a Textarea object by indexing the elements array (by number or
name) of the form or by using getElementById().
0 comments:
Post a Comment