Dom Advanced Programming

Source: Internet
Author: User

The three types of Dom standard interface (SWAP) Core DOM (Core DOM) for various structured documents; XML DOM (Java OOP), dedicated to XML documents, HTML DOM, for HTML documents, below are some of the following questions.

I. Location and History objects
Back ()//return
Forward ()
Go ()//forward
Location
HREF//Links
Reload//Load

II. Application of location and history objects

<a href="javascript:location.href= ' flower.html '"> View flowers details </a>  <a href="javascript:location.reload ()"> Refresh this page </a><a href="  Javascript:history.back ()> Return tothemain Page </a>

Iii. Common Properties of document objects

1.referrer(returns the URL of the document loaded into the current document)

2.URL(returns the URL of the current document). Document.referrer document. Url

Common methods for Document objects

getElementById () (Returns a reference to the first object with the specified ID) getelementsbyname () (Returns the collection of objects with the specified name) getElementsByTagName () (Returns the collection of objects with the specified label name) Write () (writes text, HTML expression, or JavaScript code to the document)

four or three different ways to access page elements

getElementById () is accessed by the ID name of the element

Getelementsbyname () accessed by the name of the element

getElementsByTagName () access by tag

V. Display and concealment of elements

1.visibility Visible(indicates that the element is visible)

Hidden (indicates that the element is not visible) object.style.visibility= "value"

2.display None(indicates that this element will not be displayed)

Block (indicates that this element will be displayed as a block-level element with a newline character before and after this element) object.style.display= "value"

Vi. Properties of the check box

check box for the checked property value is checked: True is unchecked: false

Dom Advanced Programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.