Home  >  Article  >  Web Front-end  >  JavaScript Tutorial: Use of Object System

JavaScript Tutorial: Use of Object System

黄舟
黄舟Original
2016-12-22 15:39:101032browse

Using the browser's internal object system, you can interact with HTML documents. Its function is to organize and package related elements and provide them to programmers, thereby reducing programmers' labor and improving their ability to design Web pages.

Browser object hierarchy and its main functions

In addition to the document object mentioned earlier, the Navigator browser also provides Window objects as well as History and Location objects.

Browser Object (Navigator)

Provides information about the browser

Window Object (Windows)

The Window object is at the top of the object hierarchy, and it provides methods and properties for handling the Navigator window.

Location Object (Location)

The Location object provides methods and properties that work with the currently opened URL. It is a static object.

History Object (History)

The History object provides information related to the history list.

Document Object (Document)

The document object contains objects that work with document elements (elements), and it encapsulates these elements for use by programmers.


Document object functions and their effects

1. Three main objects in document

In document there are mainly three most important objects: links, anchor and form: anchor anchor object, which contains All anchor information in the document. A link object refers to a hypertext or hypermedia element marked with as a specific URL. Form Form object, which contains objects in various formats to store information, can be used to write programs in JavaScript scripts for text input, and can be used to dynamically change the behavior of documents.

2. The attribute attribute in the document object

The attribute attribute in the document object is mainly used to control the format of the color and the document title, the URL of the original file of the document and the date of the last update of the document when referencing the Href identifier. .

The above is the content of the JavaScript tutorial on the use of object systems. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn