分类: Python/Ruby
2012-05-13 02:51:18
The Anchor object represents an HTML hyperlink.
For each tag in an HTML document, an Anchor object is created.
An anchor allows you to create a link to another document (with the href attribute), 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 collection property of the Document object.
Property | Description | W3C |
---|---|---|
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 |
The Area object represents an area inside an HTML image-map (an image-map is an image with clickable areas).
For each tag in an HTML document, an Area object is created.
Property | Description | W3C |
---|---|---|
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 |
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
Property | Description | W3C |
---|---|---|
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 |
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, etc.
Property | Description | W3C |
---|---|---|
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 |
Event | Description | W3C |
---|---|---|
onload | Script to be run immediately after a page is loaded | Yes |
The Button object represents a push button.
For each
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.
Property | Description | W3C |
---|---|---|
disabled | Sets or returns whether a button is disabled, or not | Yes |
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 |
The Form object represents an HTML form.
For each
Property | Description | W3C |
---|---|---|
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 |
Event | Description | W3C |
---|---|---|
onload | Script to be run immediately after a frame/iframe is loaded | Yes |
The Frameset object represents an HTML frameset.
The HTML frameset element holds two or more frame elements. Each frame element holds a separate document.
The HTML frameset element states only how many columns or rows there will be in the frameset.
Property | Description | W3C |
---|---|---|
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 |
Event | Description | W3C |
---|---|---|
onload | Script to be run immediately after a page is loaded | Yes |
The Image object represents an embedded image.
For each tag in an HTML document, an Image object is created.
Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The tag creates a holding space for the referenced image.
Property | Description | W3C |
---|---|---|
align | Sets or returns the value of the align attribute of an image | Yes |
alt | Sets or returns the value of the alt attribute of an image | Yes |
border | Sets or returns the value of the border attribute of an image | Yes |
complete | Returns whether or not the browser is finished loading an image | No |
height | Sets or returns the value of the height attribute of an image | Yes |
hspace | Sets or returns the value of the hspace attribute of an image | Yes |
longDesc | Sets or returns the value of the longdesc attribute of an 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 value of the src attribute of an image | Yes |
useMap | Sets or returns the value of the usemap attribute of an image | Yes |
vspace | Sets or returns the value of the vspace attribute of an image | Yes |
width | Sets or returns the value of the width attribute of an image | Yes |
Event | The event occurs when... | W3C |
---|---|---|
onabort | Loading of an image is interrupted | Yes |
onerror | An error occurs when loading an image | Yes |
onload | An image is finished loading | Yes |
The Checkbox object represents a checkbox in an HTML form.
Checkboxes let a user select one or more options of a limited number of choices.
For each instance of an tag in an HTML form, a Checkbox object is created.
You can access a Checkbox object by searching through the elements[] array of a form, or by using document.getElementById().
Property | Description | W3C |
---|---|---|
disabled | Sets or returns whether a checkbox is disabled, or not | Yes |
checked | Sets or returns the checked state of a checkbox | Yes |
defaultChecked | Returns the default value of the checked attribute | Yes |
form | Returns a reference to the form that contains the checkbox | Yes |
name | Sets or returns the value of the name attribute of a checkbox | Yes |
type | Returns which type of form element the checkbox is | Yes |
value | Sets or returns the value of the value attribute of a checkbox | Yes |
The FileUpload object represents a single-line text input control and a browse button, in an HTML form.
This object allow file uploading to a server. Clicking on the browse button opens the file dialog box that allows a user to select a file to upload.
For each 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().
Property | Description | W3C |
---|---|---|
disabled | Sets or returns whether the fileUpload button is disabled, or not | Yes |
accept | Sets or returns a comma-separated list of accepted content types | Yes |
form | Returns a reference to the form that contains the FileUpload object | Yes |
name | Sets or returns the value of the name attribute of the FileUpload object | Yes |
type | Returns which type of form element the FileUpload object is | Yes |
value | Returns the path or the name of the selected file | Yes |
The Hidden object represents a hidden input field in an HTML form (this input field is invisible for the user).
With this element you can send hidden form data to a server.
For each 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().
Property | Description | W3C |
---|---|---|
form | Returns a reference to the form that contains the hidden input field | Yes |
name | Sets or returns the value of the name attribute of the hidden input field | Yes |
type | Returns which type of form element a hidden input field is | Yes |
value | Sets or returns the value of the value attribute of the hidden input field | Yes |
The Password object represents a single-line password field in an HTML form.
The content of a password field will be masked (appear as blobs or asterisks) in a browser.
For each 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().
Property | Description | W3C |
---|---|---|
defaultValue | Sets or returns the default value of a password field | Yes |
disabled | Sets or returns whether the password field is disabled, or not | Yes |
form | Returns a reference to the form that contains the password field | Yes |
maxLength | Sets or returns the maximum number of characters allowed in a password field | Yes |
name | Sets or returns the value of the name attribute of a password field | Yes |
readOnly | Sets or returns whether a password field is read-only, or not | Yes |
size | Sets or returns the width of a password field (in number of characters) | Yes |
type | Returns which type of form element a password field is | Yes |
value | Sets or returns the value of the value attribute of the password field | Yes |
Method | Description | W3C |
---|---|---|
select() | Selects the content of a password field | Yes |
The Radio object represents a radio button in an HTML form.
Radio buttons allow the user to select only ONE of a predefined set of options. You define groups with the name property (radio buttons with the same name belong to the same group).
For each 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().
Property | Description | W3C |
---|---|---|
checked | Sets or returns the checked state of a radio button | Yes |
defaultChecked | Returns the default value of the checked attribute | Yes |
disabled | Sets or returns whether the radio button is disabled, or not | Yes |
form | Returns a reference to the form that contains the radio button | Yes |
name | Sets or returns the value of the name attribute of a radio button | Yes |
type | Returns which type of form element the radio button is | Yes |
value | Sets or returns the value of the value attribute of the radio button | Yes |
The Text object represents a single-line text input field in an HTML form.
For each 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().
Property | Description | W3C |
---|---|---|
defaultValue | Sets or returns the default value of a text field | Yes |
disabled | Sets or returns whether the text field is disabled, or not | Yes |
form | Returns a reference to the form that contains the text field | Yes |
maxLength | Sets or returns the maximum number of characters allowed in a text field | Yes |
name | Sets or returns the value of the name attribute of a text field | Yes |
readOnly | Sets or returns whether a text field is read-only, or not | Yes |
size | Sets or returns the width of a text field (in number of characters) | Yes |
type | Returns which type of form element a text field is | Yes |
value | Sets or returns the value of the value attribute of the text field | Yes |
Method | Description | W3C |
---|---|---|
select() | Selects the content of a text field | Yes |
The Link object represents an HTML link element.
The link element must be placed inside the head section of an HTML document, and it specifies a link to an external resource.
A common use of the tag is to link to external style sheets.
Property | Description | W3C |
---|---|---|
charset | Sets or returns the character encoding of a linked document | Yes |
href | Sets or returns the URL of a linked document | Yes |
hreflang | Sets or returns the language code of the linked document | Yes |
media | Sets or returns the media type for the link element | Yes |
rel | Sets or returns the relationship between the current document and the linked document | Yes |
rev | Sets or returns the reverse relationship from the linked document to the current document | Yes |
type | Sets or returns the content type of the linked document | Yes |
The Meta object represents an HTML meta element.
tags must be placed inside the head section of an HTML document, and they provide metadata about the HTML document.
Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata. Metadata can be used by browsers (e.g. how to display content or reload pages), search engines (e.g. keywords), or other web services.
Property | Description | W3C |
---|---|---|
content | Sets or returns the value of the content attribute of a meta element | Yes |
httpEquiv | Sets or returns an HTTP header for the information in the content attribute | Yes |
name | Sets or returns a name for the information in the content attribute | Yes |
scheme | Sets or returns how the value of content should be interpreted | Yes |
The Object object represents an HTML object element.
The
Property | Description | W3C |
---|---|---|
align | Sets or returns the alignment of the object according to the surrounding 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 | Yes | |
data | Yes | |
declare | 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 | Yes | |
vspace | Sets or returns the vertical margin of the object | Yes |
width | Sets or returns the width of the object | Yes |
The Option object represents an option in a dropdown list in an HTML form.
For each
You can access an Option object by searching through the elements[] array of a form, or by using document.getElementById().
Property | Description | W3C |
---|---|---|
defaultSelected | Returns the default value of the selected attribute | Yes |
disabled | Sets or returns whether an option is disabled, or not | Yes |
form | Returns a reference to the form that contains the option | Yes |
index | Sets or returns the index position of an option in a dropdown list | Yes |
selected | Sets or returns the value of the selected attribute | Yes |
text | Sets or returns the text of an option element | Yes |
value | Sets or returns the value to be sent to the server | Yes |
The Select object represents a dropdown list in an HTML form.
A dropdown list lets a user select one or more options of a limited number of choices.
For each
You can access a Select object by searching through the elements[] array of a form, or by using document.getElementById().
Collection | Description | W3C |
---|---|---|
options | Returns a collection of all the options in a dropdown list | Yes |
Property | Description | W3C |
---|---|---|
disabled | Sets or returns whether the dropdown list is disabled, or not | Yes |
form | Returns a reference to the form that contains the dropdown list | Yes |
length | Returns the number of options in a dropdown list | Yes |
multiple | Sets or returns whether more than one item can be selected from the dropdown list | Yes |
name | Sets or returns the name of a dropdown list | Yes |
selectedIndex | Sets or returns the index of the selected option in a dropdown list | Yes |
size | Sets or returns the number of visible options in a dropdown list | Yes |
type | Returns which type of form element a dropdown list is | Yes |
Method | Description | W3C |
---|---|---|
add() | Adds an option to a dropdown list | Yes |
remove() | Removes an option from a dropdown list | Yes |
The Table object represents an HTML table.
For each
Collection | Description | W3C | ||
---|---|---|---|---|
cells | Returns a collection of all | or | elements in a table | No |
rows | Returns a collection of all | |||
Yes | ||||
tBodies | Returns a collection of all | Yes |
Property | Description | W3C |
---|---|---|
align | Deprecated. Sets or returns the alignment of a table according to surrounding text. Use style.textAlign instead | D |
background | Deprecated. Sets or returns the background image of a table. Use style.backgroundinstead | D |
bgColor | Deprecated. Sets or returns the background color of a table. Usestyle.backgroundColor instead | D |
border | Deprecated. Sets or returns the width of the table border. Use style.border instead | D |
caption | 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 which outer-borders (of a table) that should be displayed | Yes |
height | Deprecated. Sets or returns the height of a table. Use style.height instead | D |
rules | Sets or returns which inner-borders (between the cells) that should be displayed in a table | Yes |
summary | Sets or returns a description of the data in a table | Yes |
tFoot | Returns a reference to the tfoot element of a table | Yes |
tHead | Returns a reference to the thead element of a table | Yes |
width | Deprecated. Sets or returns the width of the table. Use style.width instead | D |
Method | Description | W3C |
---|---|---|
createCaption() | Creates an empty caption element and adds it to the table | Yes |
createTFoot() | Creates an empty tfoot element and adds it to the table | Yes |
createTHead() | Creates an empty thead element and adds it to the table | Yes |
deleteCaption() | Removes the first caption element from the table | Yes |
deleteRow() | Removes a row from the table | Yes |
deleteTFoot() | Removes the tfoot element from the table | Yes |
deleteTHead() | Removes the thead element from the table | Yes |
insertRow() | Creates an empty tr element and adds it to the table | Yes |
The td object represents a data cell in an HTML table.
For each
The th object represents a table header cell in an HTML table.
For each
Property | Description | W3C |
---|---|---|
abbr | Sets or returns an abbreviated version of the content in a data cell | Yes |
align | Deprecated. Sets or returns the horizontal alignment of the content in a data cell. Use style.textAlign instead | D |
axis | Sets or returns a comma-separated list of related data cells | Yes |
background | Deprecated. Sets or returns the background image of a data cell. Usestyle.background instead | D |
bgColor | Deprecated. Sets or returns the background color of a table. Usestyle.backgroundColor instead | D |
cellIndex | Returns the position of a cell in the cells collection of a table row | Yes |
ch | Sets or returns an alignment character for a data cell | Yes |
chOff | Sets or returns the horizontal offset of the ch property | Yes |
colSpan | Sets or returns the number of columns a cell should span | Yes |
headers | Sets or returns a list of header cell ids for the current data cell | Yes |
height | Deprecated. Sets or returns the height of a data cell. Use style.height instead | D |
noWrap | Deprecated. Sets or returns whether the content in a cell can be wrapped. Usestyle.whiteSpace instead | D |
rowSpan | Sets or returns the number of rows a cell should span | Yes |
vAlign | Sets or returns the vertical alignment of the content within a cell | Yes |
width | Deprecated. Sets or returns the width of a data cell. Use style.width instead | D |
The tr object represents an HTML table row.
For each
Collection | Description | W3C | ||
---|---|---|---|---|
cells | Returns a collection of all | or | elements in a table row | Yes |
Property | Description | W3C |
---|---|---|
align | Deprecated. Sets or returns the horizontal alignment of the content within a table row. Use style.textAlign instead | D |
bgColor | Deprecated. Sets or returns the background color of a table row. Usestyle.backgroundColor instead | D |
ch | Sets or returns an alignment character for cells in a table row | Yes |
chOff | Sets or returns the horizontal offset of the ch property | Yes |
height | Deprecated. Sets or returns the height of a table row. Use style.height instead | D |
rowIndex | Returns the position of a row in the rows collection of a table | Yes |
sectionRowIndex | Returns the position of a row in the rows collection of a tbody, thead, or tfoot | Yes |
vAlign | Sets or returns the vertical alignment of the content within a table row | Yes |
Method | Description | W3C |
---|---|---|
deleteCell() | Deletes a cell from the current table row | Yes |
insertCell() | Inserts a cell into the current table row | Yes |
The Textarea object represents a text-area in an HTML form.
For each
You can access a Textarea object by indexing the elements array (by number or name) of the form or by using getElementById().
Property | Description | W3C |
---|---|---|
cols | Sets or returns the width of a text area | Yes |
defaultValue | Sets or returns the default value of a text area | Yes |
disabled | Sets or returns whether the text area is disabled, or not | Yes |
form | Returns a reference to the form that contains the text area | Yes |
name | Sets or returns the name of a text area | Yes |
readOnly | Sets or returns whether the contents of a text area is read-only | Yes |
rows | Sets or returns the height (in rows) of a text area | Yes |
type | Returns the type of the form element the text area is | Yes |
value | Sets or returns the contents of a text area | Yes |
Method | Description | W3C |
---|---|---|
select() | Selects the entire contents of a text area | Yes |