Use the browser's internal object system to interact with the HTML document. Its role is to package related elements to provide programming designers, reducing programmers, and improving the ability to design web pages.
First, the browser object level and its main role
In addition to the previously mentioned document Document objects, the Navigator browser also provides Window Objects, and History and Location objects.
Browser Object (Navigator)
Provide information about the browser
Window Object (Windows)
The Window object is at the top of the object level, which provides methods and properties that process the Navigator window.
Location object (location)
The Location object provides methods and properties that work with the current URL, which is a static object.
Historical object (History)
The History object provides information about historical list.
Document Object (Document)
The Document object contains objects working with document elements (Elements), which encapsulates these elements for programmers.
Programmakers use these objects to control and process the events in the WWW browser environment. It provides a very rich internal method and attribute in JavaScript, thereby reducing the work of programmers and improving programming efficiency. This is exactly based on object and object-oriented differences. In these object systems, document objects are very important, it is located at the lowest layer, but is a key role in our implementation of Web page information interaction. Therefore it is the core part of the object system.
Second, document object function and its role
In the Navigator browser, the Document document object is the core is the most important. See Figure 6-1.
Links Anchor Form Method Prop
Link Object Anchor Object Form Object Method Object
Figure 6-1 Document object
As can be seen from Figure 6-1, the main role of the Document object is to package these basic elements (such as Links, Anchor, etc.) to provide programmers. From another perspective, the Document object is composed of attributes and methods.
1, three main objects in Document
In Document, there are three most important objects such as Links, Anchor, Form:
(1) Anchor Anchor Object:
The Anchor object refers to the object that is form>