Home > front end >  Js common properties and methods of the dom
Js common properties and methods of the dom

Time:10-10

1. The collection of objects:

(1). All [];

(2). Images [];

(3). Anchors [];

(4). The forms [];

(5). The links [];

2. Properties:

Document. Cookies; Sets or returns the current documents about all the cookies

Document. The title; Returns the title of the current document

Document. The domain; Returns the current document of the domain name

Document. The URL; Returns the current document's URL

Document. The referrer if the current document does not come in through the hyperlink to access, the null

This property allows a client JavaScript to access the HTTP references head

3. Methods:

Obj=document. The open (); Open a new document

Obj. Close (); Close the document object;

Obj. Write (); To the written document object expression HTML or JavaScript code

Obj. Writeln (); Equivalent to the write () method is different in each expression after writing a newline

//-- -- -- -- -- -- -- -- -- -- -- -- -- -- element -- -- -- -- -- -- -- -- -- -- -- --

Properties and methods: getElementsByTagName_r ("); Return with objects in the specified tag name,

GetElementById ("); Returns the id of the first object with the reference,

GetElementsByName ("); Returns a collection of objects with a specified name,

Element. The getAttributeNode (); Returns the specified attribute node

Element. The.childnodes (); Return element child node collection

Element. The firstChild; Returns the first child of the element

Element. LastChild; Returns the elements last child element

Element. ParentNode; Returns the elements in the parent node

Element. PreviousSibling; Before a brother node

Element. NextSibling; Returned in the same node tree hierarchy of the next node

Element. The ownerDocument returns the root element of the element (the document object)

Element. The getAttribute ("); Returns the element node specified attribute values

Element. The createAttribute ("); Create attribute

Element. CreateElement_x ("); Create element

Element. The setAttribute (); The specified attribute set or change for the specified value

Element. The setAttributeNode (); To set or change the attributes of the specified element node. RemoveChild (); Removed from the element node

Element. The removeAttributeNode (); Remove the specified attribute node, and returns the removed node

Element. The removeAttribute (); Removed from the element specified attribute

Element. The replaceChild (); Replace the element of the child node

Element. The insertBefore (); Before the child nodes of the specified for inserting new node

Element. The appendChild (); To the element, add a new child node as the last child node element. The hasAttribute (); If the element has attributes specified, return true or false

Element. The hasAttributes (); If the element has attributes, it returns true or false

Element. The hasChildNodes (); If the element has child nodes, then return true, otherwise false

Element. IsEqualNode (); Check whether the two elements is equal to

Element. IsDefaultNamespace (); Specified namespaceURI is the default, then return true, otherwise it returns false element. The accessKey: shortcuts

Element. The attributes: attributes set

Element. The className: class attribute

Element. The id is the id attribute

Element. The tagName tag name

Element. The style style attribute

Element. The nodeName element name


element. The nodeType element type
Element. The nodeValue element content

Element. The namespaceURI return element namespace URI

Element. The title

Nodelist. Length

Element. The textContent sets or returns the node and its descendants text content

Element. The innerHTML sets or returns the node (not including nodes) within the HTML

Element. The outerHTML sets or returns the node (including nodes) within the HTML

Element. The element offsetHeight height

Element. The offsetTop returns the elements vertical offset,

Element. The scrollTop returns the distance between the edge element with the view,

Element. ScrollHeight returns the elements of the overall height

Element. ClientHeight return elements of visual height element. ToStrings (); Converts a string

Special properties and methods:

Meta:

The content set or return the value of the content attribute of the meta element,

HttpEquiv content attribute to link to an HTTP headers,

Name connects content attribute to a particular name,

Scheme set or return the value of attribute is used to explain the content format, frameset:

Cols: sets or returns the number of columns in frame

Rows: sets or returns the number of the framework of the bank of China

Frame the iframe:

The SRC name marginHeight marginWidth Height Width

Scrolling (yes/no)

NoResize (true/false)

Frameborder (1/0)

ContentDocument frame window in the document content

The table/tableCell/tableRow:

Cols rows [] []

BgColor border width Hieght cellSpacing cellPadding caption

CreateCaption () as your table to create a caption element

DeleteCaption () removed from table caption element and its content

CreateTHead () creates an empty in the form of tHead element

DeleteTHead () from table delete the tHead element and its content

CreateTFoot () in the table to create an empty tFoot element

DeleteTFoot () from the table to delete tFoot element and its content

InsertRow () to insert a new row in the table

DeleteRow () to delete a line from table

RowSpan set or return the cell can across the number of rows

CloSpan sets or returns the cell can be across the number of columns

The align calign height width

Ol:

Reversed set or the returned list is for descending sequence,

Start sets or returns an ordered list of start attribute values,

Type sets or returns an ordered list of the type attribute value,

Li:

The value is set or return the value of the list item form:

The action set or go back to the form action attribute,

Id set or go back to the form of id,

Length returns the number of elements that form,

Method sets or returns the data sent to the server HTTP method,

Name the name of the set or go back to the form,

Target set or return the form to submit results of Frame or Window name,

Reset () the form of all input elements reset to their default values,

Submit the form submit () onreset call before reset form elements,

Onsubmit call before submitting the form input text/password/hidden/File:

The accessKey set shortcuts or return visit text fields,

Alt or return when the browser does not support text field replacement text for display,

DefaultValue sets or returns the default value of text fields,

ReadOnly set or return whether text fields should be read-only,

Disabled sets or returns whether the text field should be disabled,

MaxLength sets or returns the text field maximum number of characters,

Id sets or returns the text field id,

The name sets or returns the text field name,

The size sets or returns the size of the text field,

Type returns the text field form element types,

The value to set or return the value of text fields of the value attribute

The blur () from the diverse text fields,

Focus () set focus on text fields,

Select () to select the content of the text field, input button/reset:

The accessKey sets or returns the access button shortcuts,

Alt set or return when the browser can't display button replacement text for display,

Disabled sets or returns whether disable button,

Id id set or back button,

The name sets or returns the name of the button,

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related