Home >Web Front-end >JS Tutorial >DOM Advanced Programming_DOM
Foreword: Three types of DOM standard interfaces (image changing) stipulated by W3C: Core DOM (core DOM), suitable for various structured documents; XML DOM (learned in Java OOP), dedicated to XML documents; HTML DOM, dedicated For HTML documents, let’s understand the following questions.
1. Location and history objects
back() //Return
forward()
go() //Forward
location
href //Link
reload //Load
2. Application of location and history objects
3. Common properties of Document object
1.referrer (returns the URL of the document that loads the current document)
2.URL (returns the URL of the current document) document.referrer document.URL
Common methods of Document object
Four. The differences between the three access page elements
getElementById() accesses the element by its ID name
getElementsByName() accesses elements by their name
getElementsByTagName() access by tag
5. Displaying and hiding elements
1.visibility visible (indicates that the element is visible)
hidden (indicates that the element is invisible) 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 line breaks before and after this element) object.style.display="value"
6. Attributes of check boxes
Checked attribute value of the check box Checked: true Unchecked: false