- D3.js 4.x Data Visualization(Third Edition)
- ?ndrew Rininsland Swizec Teller
- 231字
- 2021-07-02 23:20:25
DOM
The Document Object Model (DOM) is a language-agnostic model for representing structured documents built in HTML, XML, or similar standards. You can think of it as a tree of nodes that closely resembles the document parsed by the browser.
At the top, there is an implicit document node, which represents the <html> tag; browsers create this tag even if you don't specify it and then build the tree off this root node according to what your document looks like. Consider a simple HTML file to be like the following:
<!DOCTYPE html>
<title>A title</title>
<p>
<p>A paragraph of text</p>
</p>
<ul>
<li>List item</li>
<li>List item 2, <em><strong>italic</strong></em></li>
</ul>
Note how we don't have the <html>, <head> or <body> tags. Chrome will parse the preceding code to DOM, as follows:

Type document into the Chrome JavaScript console to get this tree view. You can expand it by double-clicking; Chrome will then highlight the section of the page relating to the specified element when you hover over it in the console.
You can also test random selections by typing $('.some-selector') into the console. Even if jQuery isn't included in this page, it will still work because it's built into Chrome's console as an alias for document.querySelector('.some-selector') (and is then overridden by jQuery if it's included in the page). Additionally, $$('.some-selector') acts as a shortcut to document.querySelectorAll('.some-selector), if you want to return more than just the first element in the selection.
- JavaScript百煉成仙
- vSphere High Performance Cookbook
- Essential Angular
- PHP網(wǎng)絡(luò)編程學(xué)習(xí)筆記
- 網(wǎng)絡(luò)爬蟲原理與實(shí)踐:基于C#語(yǔ)言
- Salesforce Reporting and Dashboards
- Multithreading in C# 5.0 Cookbook
- PHP+Ajax+jQuery網(wǎng)站開(kāi)發(fā)項(xiàng)目式教程
- .NET 4.5 Parallel Extensions Cookbook
- 零基礎(chǔ)學(xué)Scratch 3.0編程
- Visual Basic程序設(shè)計(jì)全程指南
- Clojure Polymorphism
- Selenium WebDriver Practical Guide
- Spark技術(shù)內(nèi)幕:深入解析Spark內(nèi)核架構(gòu)設(shè)計(jì)與實(shí)現(xiàn)原理
- iOS Development with Xamarin Cookbook