javascript(七)--其它HTML DOM对象

1067阅读 0评论2012-05-13 yourtommy
分类:Python/Ruby

Anchor

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.


PropertyDescriptionW3C
charsetSets or returns the value of the charset attribute of a linkYes
hrefSets or returns the value of the href attribute of a linkYes
hreflangSets or returns the value of the hreflang attribute of a linkYes
nameSets or returns the value of the name attribute of a linkYes
relSets or returns the value of the rel attribute of a linkYes
revSets or returns the value of the rev attribute of a linkYes
targetSets or returns the value of the target attribute of a linkYes
typeSets or returns the value of the type attribute of a linkYes

Area

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.


PropertyDescriptionW3C
altSets or returns the value of the alt attribute of an areaYes
coordsSets or returns the value of the coords attribute of an areaYes
hashSets or returns the anchor part of the href attribute valueYes
hostSets or returns the hostname:port part of the href attribute valueYes
hostnameSets or returns the hostname part of the href attribute valueYes
hrefSets or returns the value of the href attribute of an areaYes
noHrefSets or returns the value of the nohref attribute of an areaYes
pathnameSets or returns the pathname part of the href attribute valueYes
portSets or returns the port part of the href attribute valueYes
protocolSets or returns the protocol part of the href attribute valueYes
searchSets or returns the querystring part of the href attribute valueYes
shapeSets or returns the value of the shape attribute of an areaYes
targetSets or returns the value of the target attribute of an areaYes

Base

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 tag in an HTML document, a Base object is created.


PropertyDescriptionW3C
hrefSets or returns the value of the href attribute in a base elementYes
targetSets or returns the value of the target attribute in a base elementYes

Body

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.


PropertyDescriptionW3C
aLinkSets or returns the value of the alink attribute of the body elementYes
backgroundSets or returns the value of the background attribute of the body elementYes
bgColorSets or returns the value of the bgcolor attribute of the body elementYes
linkSets or returns the value of the link attribute of the body elementYes
textSets or returns the value of the text attribute of the body elementYes
vLinkSets or returns the value of the vlink attribute of the body elementYes
EventDescriptionW3C
onloadScript to be run immediately after a page is loadedYes

Button

The Button object represents a push button.

For each

PropertyDescriptionW3C
disabledSets or returns whether a button is disabled, or notYes
formReturns a reference to the form that contains a buttonYes
nameSets or returns the value of the name attribute of a buttonYes
typeSets or returns the type of a buttonYes
valueSets or returns the value of the value attribute of a buttonYes

Form

The Form object represents an HTML form.

For each

tag in an HTML document, a Form object is created.

Forms are used to collect user input, and contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select menus, textarea, fieldset, legend, and label elements.

Forms are used to pass data to a server.


PropertyDescriptionW3C
acceptCharsetSets or returns the value of the accept-charset attribute in a formYes
actionSets or returns the value of the action attribute in a formYes
enctypeSets or returns the value of the enctype attribute in a formYes
lengthReturns the number of elements in a formYes
methodSets or returns the value of the method attribute in a formYes
nameSets or returns the value of the name attribute in a formYes
targetSets or returns the value of the target attribute in a formYes


Frame

The Frame object represents an HTML frame.

The tag defines one particular window (frame) within a frameset.

For each tag in an HTML document, a Frame object is created.

IFrame

The IFrame object represents an HTML inline frame.

The