GitHub 中文社区
回车: Github搜索    Shift+回车: Google搜索
论坛
排行榜
趋势
登录

©2025 GitHub中文社区论坛GitHub官网网站地图GitHub官方翻译

  • X iconGitHub on X
  • Facebook iconGitHub on Facebook
  • Linkedin iconGitHub on LinkedIn
  • YouTube iconGitHub on YouTube
  • Twitch iconGitHub on Twitch
  • TikTok iconGitHub on TikTok
  • GitHub markGitHub’s organization on GitHub
集合主题趋势排行榜
#

Document Object Model (DOM)

DOM (short for Document Object Model) is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document. Nodes can have event handlers (also known as event listeners) attached to them. Once an event is triggered, the event handlers get executed.

The principal standardization of the DOM was handled by the World Wide Web Consortium (W3C), which last developed a recommendation in 2004. WHATWG took over the development of the standard, publishing it as a living document. The W3C now publishes stable snapshots of the WHATWG standard.

In HTML DOM (Document Object Model), every element is a node:

  • A document is a document node.
  • All HTML elements are element nodes.
  • All HTML attributes are attribute nodes.
  • Text inserted into HTML elements are text nodes.
  • Comments are comment nodes.

Created by World Wide Web Consortium

发布于 October 1, 1998

Repository
whatwg/dom
Website
dom.spec.whatwg.org
Wikipedia
维基百科

相关主题

HTMLXML
preactjs/preact
https://static.github-zh.com/github_avatars/preactjs?size=40
preactjs / preact

Preact = performance + react,它是React的3KB轻量替代方案

Preact.jsJSX (JavaScript XML)Reactvirtual-domcomponentsDocument Object Model (DOM)vdom
JavaScript 37.84 k
6 小时前
https://static.github-zh.com/github_avatars/niklasvh?size=40
niklasvh / html2canvas

一个用于实现网页截图的 JavaScript 库

JavaScriptscreenshotDocument Object Model (DOM)
TypeScript 31.41 k
1 年前
https://static.github-zh.com/github_avatars/cheeriojs?size=40
cheeriojs / cheerio

#网络爬虫#一个运行在服务端的 jQuery 实现,用于解析和操作 HTML 及 XML

cheeriojQueryhtmlparser2Document Object Model (DOM)htmlparserselectorscraperParserHTMLHacktoberfest
TypeScript 29.66 k
1 天前
leptos-rs/leptos
https://static.github-zh.com/github_avatars/leptos-rs?size=40
leptos-rs / leptos

Build fast web applications with Rust.

Document Object Model (DOM)fine-grainedisomorphicreactiveRustssrWebWebAssembly
Rust 18.83 k
4 天前
https://static.github-zh.com/github_avatars/cure53?size=40
cure53 / DOMPurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

xssSanitizationDocument Object Model (DOM)安全JavaScriptdompurifyprevent-xss-attacksmathmlHTMLSVGcross-site-scripting
JavaScript 15.6 k
9 天前
https://static.github-zh.com/github_avatars/marko-js?size=40
marko-js / marko

#前端开发#A declarative, HTML-based language that makes building web apps fun

JavaScriptui-componentsDocument Object Model (DOM)vdomNode.js服务端渲染client-side-renderingisomorphic前端
JavaScript 13.65 k
9 天前
QwikDev/partytown
https://static.github-zh.com/github_avatars/QwikDev?size=40
QwikDev / partytown

Partytown 是一个 JavaScript 延迟加载库,帮助我们将资源密集型脚本迁移到Web Worker 中,与主线程分离。

webworker3rd-party3rdpartyweb-workerperformanceanalyticscore-web-vitalslighthouselighthouse-scoreJavaScriptDocument Object Model (DOM)
TypeScript 13.43 k
15 天前
https://static.github-zh.com/github_avatars/answershuto?size=40
answershuto / learnVue

:octocat:Vue.js 源码解析

Vue.jsvue-templateDocument Object Model (DOM)diffdom-nexttickvue-router
JavaScript 12.73 k
2 年前
jhy/jsoup
https://static.github-zh.com/github_avatars/jhy?size=40
jhy / jsoup

jsoup 是一个用于解析、提取、操作HTML的Java库

jsoupHTMLJavaDocument Object Model (DOM)CSSjava-html-parsercss-selectorsXMLxpathParser
Java 11.22 k
2 天前
https://static.github-zh.com/github_avatars/tsayen?size=40
tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas

CanvasHTMLDocument Object Model (DOM)renderImagerastervectorJavaScriptCSSSVG
JavaScript 10.67 k
1 年前
fabiospampinato/cash
https://static.github-zh.com/github_avatars/fabiospampinato?size=40
fabiospampinato / cash

An absurdly small jQuery alternative for modern browsers.

cashselectormodern-browsersJavaScriptDocument Object Model (DOM)jquery-alternativeTypeScripttinysmalljQuery
JavaScript 7.04 k
1 年前
https://static.github-zh.com/github_avatars/choojs?size=40
choojs / choo

🚂🚋 - sturdy 4kb frontend framework

chooDocument Object Model (DOM)uiunidirectionalminimalinterfacemodularvanilla
JavaScript 6.77 k
6 年前
https://static.github-zh.com/github_avatars/zeroclipboard?size=40
zeroclipboard / zeroclipboard

#前端开发#[停止维护] ZeroClipboard 库提供了一种使用不可见的 Adobe Flash movie 和 JavaScript 接口将文本复制到剪贴板的简单方法。

zeroclipboardJavaScriptflashadobe-flashapache-flexclipboardDocument Object Model (DOM)Web前端adobe-flex
JavaScript 6.61 k
4 年前
phuocng/html-dom
https://static.github-zh.com/github_avatars/phuocng?size=40
phuocng / html-dom

Common tasks of managing HTML DOM with vanilla JavaScript. Give me 1 ⭐if it’s useful.

Document Object Model (DOM)document-object-modelHTMLdom-apiTypeScriptJavaScriptdom-manipulation
MDX 6.57 k
1 年前
https://static.github-zh.com/github_avatars/bubkoo?size=40
bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.

screenshotCanvasSVGdataurlImageDocument Object Model (DOM)JavaScript
TypeScript 6.56 k
1 个月前
https://static.github-zh.com/github_avatars/imba?size=40
imba / imba

#编程语言#Imba 是一种面向 Web App 的新编程语言,受Ruby启发,可编译成具有高性能和可读性的JavaScript。

编程语言JavaScriptimbaDocument Object Model (DOM)前端declarative框架ui
JavaScript 6.45 k
3 天前
https://static.github-zh.com/github_avatars/web-platform-tests?size=40
web-platform-tests / wpt

Web平台规范测试套件,用于浏览器兼容性测试

TestingHTMLTest automationbrowserw3cwhatwgtest-runnerweb-standardsJavaScriptDocument Object Model (DOM)web-developmentChromeblinkgeckoFirefoxEdgesafariWebKitopera
HTML 5.49 k
1 小时前
https://static.github-zh.com/github_avatars/Rich-Harris?size=40
Rich-Harris / ramjet

Morph DOM elements from one state to another with smooth animations and transitions

动画transitionsDocument Object Model (DOM)fxeffectsCSS
JavaScript 5.44 k
8 年前
https://static.github-zh.com/github_avatars/AngleSharp?size=40
AngleSharp / AngleSharp

👼 The ultimate angle brackets parser library parsing HTML5, MathML, SVG and CSS to construct a DOM based on the official W3C specifications.

anglesharpDocument Object Model (DOM)C#HTMLParserLibraryangle-bracketlinqHacktoberfest
C# 5.36 k
9 天前
https://static.github-zh.com/github_avatars/scinfu?size=40
scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)

SwiftswiftsoupParsinghtml-documentDocument Object Model (DOM)extractselectorHTML
Swift 4.9 k
2 天前
loading...