Home >Web Front-end >Front-end Q&A >What does document mean in jquery

What does document mean in jquery

WBOY
WBOYOriginal
2022-05-18 16:50:515466browse

In jquery, document means document, which represents the DOM element loaded in the browser window. It is often used to represent the entire web page document object; the HTML document loaded into the browser will become the Document object, which is the Window object. part, accessible via "window.document".

What does document mean in jquery

The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.

What does document mean in jquery?

Document means document

Every HTML document loaded into the browser will become a Document object.

The Document object allows us to access all elements in the HTML page from scripts (JavaScript).

Tip: The Document object is part of the Window object and can be accessed through the window.document property.

Window and document, intuitively speaking, window represents the browser window, and document represents the DOM element loaded in the browser window. Furthermore, document is an attribute of window, and window is the top-level Object.

$(document) means to obtain the entire web page document object (similar to window.document).

Examples are as follows:

document.body.onclick="func()" [2]  //鼠标指针单击对象时触发
document.body.onmouseover="func()" //鼠标指针移到对象时触发
document.body.onmouseout="func()" //鼠标指针移出对象时触发

Extended knowledge:

The HTMLDocument interface extends the DOMDocument interface and defines HTML-specific properties and methods.

Many properties and methods are HTMLCollection objects (actually read-only arrays that can be indexed by array or name), which hold references to anchors, forms, links, and other scriptable elements.

These collection properties are derived from level 0 DOM. They have been superseded by Document.getElementsByTagName(), but are still often used because they are convenient.

The write() method is worth noting because it allows a script to insert dynamically generated content into the document while the document is loading and parsing.

Recommended related video tutorials: jQuery video tutorial

The above is the detailed content of What does document mean in jquery. For more information, please follow other related articles on the PHP Chinese website!

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