当前位置:网站首页>Related concepts and operations of DOM model
Related concepts and operations of DOM model
2022-07-28 05:51:00 【Still love me】
DOM Basic concepts
Document object model (DOM,Document Object Model) Is aimed at XML But extended to HTML Application programming interface for (API,Application Programming Interface)
DOM Display and operation HTML and XML The basis of document content API, among Document -- XML file or HTML file ;Object -- Object Properties and methods of objects ;Model -- Model Model ,DOM Is aimed at XML or HTML Based on tree structure API
according to W3C DOM standard ,DOM It's a browser , platform , Language independent interfaces , It allows us to access other standard components of the page
DOM Map the whole page to a multi-layer node structure ,HTML or XML Each component of the page is a node of some kind , These nodes contain different types of data .

Core DOM The operation of
Look at the node
getElementById(); By element id Value to view
getElementsByName(); Of the query element name attribute
getElementByTagName(); Returns a collection of objects with the specified label name
The parent node finds the child node
Find child node objects through parent node objects ( There may be text nodes ) Compatibility is good.
Parent node object .firstChild Find the first child node under the parent node
Parent node object .lastChild Find the last child node under the parent node
Parent node object .childNodes Multiple Find all child nodes under the parent node
Find the child element node object through the parent node object
Parent node object .firstElementChild Find the first child element node under the parent node
Parent node object .lastElementChild Find the last child element node under the parent node
Parent node object .children Multiple Find all child element nodes under the parent node
The child node finds the parent node
Child node object .parentNode Find the parent node through the child node
Child node object .parentElement Find parent elements through child nodes
Search between brothers
.nextSibling Find the next sibling May be text
.nextElementSibling Find the next element sibling node
.previousSibling Find the last sibling May be text
.previousElementSibling Find the sibling node of the previous element
Node object
Node object .getAttribute(" Property name ") Get the property value according to the property name
Node object .setAttribute(" Property name "," Property value ")
Node object .removeAttribute(" Property name ") Delete the corresponding pair of genera
边栏推荐
- Help document making based on easy CHM and vs
- Review of metallurgical physical chemistry --- electrodeposition and reduction process of metals
- 结果填空 星系炸弹(Excel秒杀)
- ArcMap map map projection related operations
- 【面试题】防抖和节流
- 基于Easy CHM和VS的帮助文档制作
- Add the corresponding subscripts of multiple arrays in the object
- 书籍-社会性动物
- Review of metallurgical physical chemistry -- cathodic polarization, overpotential, anode and anode process in metal electrodeposition
- Review of metallurgical physical chemistry -- Fundamentals of chemical reaction kinetics
猜你喜欢

flex弹性盒子项目属性

蓝桥代码 翻硬币(我这样写也通过了,官网测试是不是有问题)

结果填空 星系炸弹(Excel秒杀)

Review of metallurgical physical chemistry -- Fundamentals of chemical reaction kinetics

Distance toolbar in ArcMap (distance)

(php毕业设计)基于thinkphp5小区物业管理系统

js-宏任务和微任务

ArcMap中的距离工具条(Distance)

ArcGIS Engine开发资源

Merge two ordered arrays of order table OJ
随机推荐
ArcGIS之Model Builder
【博学谷学习记录】超强总结,用心分享 | 集合
softmax多分类 梯度推导
Annotation and grid addition of ArcGIS map making
标准C语言学习总结8
五子棋优化版
Shell operation principle
Implementation of date class and its basic functions
记录某某小卢的第一篇文章
MYSQL之搭建数据库系列(一)——下载MYSQL
media-搭建直播服务器
(php毕业设计)基于php甘肃旅游网站管理系统获取
ES6 new data types -- > symbol, map, set
(php毕业设计)基于php在线旅游网站管理系统获取
Arcgis Engine安装的若干问题
DOM基础
结果填空 煤球数目
【uni-app】uni-app中scroll-into-view的使用
结果填空 生日蜡烛
蓝桥代码 错误票据