![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DOM
笑望灬星辰
这个作者很懒,什么都没留下…
展开
-
attribute和property的区别是什么
attribute和property的区别是什么 attribute 是 dom 元素在⽂档中作为 html 标签拥有的属性; property 就是 dom 元素在 js 中作为对象拥有的属性。 对于 html 的标准属性来说, attribute 和 property 是同步的,是会⾃动更新的 但是对于⾃定义的属性来说,他们是不同步的 ...原创 2021-04-21 23:40:37 · 458 阅读 · 0 评论 -
重绘和回流(重排)是什么,如何避免?
重绘和回流(重排)是什么,如何避免? DOM的变化影响到了元素的⼏何属性(宽⾼),浏览器重新计算元素的⼏何属性,其他元素的⼏何 属性和位置也会受到影响,浏览器需要重新构造渲染树,这个过程称为重排,浏览器将受 到影响的部分 重新绘制到屏幕上的过程称为重绘。引起重排的原因有 1. 添加或者删除可⻅的DOM元素 2. 元素位置、尺⼨、内容改变 3. 浏览器⻚⾯初始化 4. 浏览器窗⼝尺⼨改变,重排⼀定重绘,重绘不⼀定重排 减少重绘和重排的方法 1. 不在布局信息改变时做 DOM 查询 2.原创 2021-04-08 23:25:53 · 511 阅读 · 0 评论 -
dom - 创建节点
直接上代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>创建节点</title> </head> <body> <div id=原创 2020-11-02 14:03:56 · 653 阅读 · 0 评论 -
dom - 查找元素之8大方法
直接上代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>查找节点8种方法</title> </head> <body> <d原创 2020-11-01 01:02:08 · 880 阅读 · 0 评论 -
dom - js事件绑定快捷键
直接上代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>快捷键</title> </head> <body> <div id原创 2020-11-01 00:17:08 · 1624 阅读 · 0 评论 -
dom - keyCode
直接上代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>keyCode</title> </head> <body> <!--原创 2020-10-31 23:31:11 · 475 阅读 · 0 评论 -
dom - altkey
直接上代码 dom - altkey <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>altKey</title> </head> <body>原创 2020-10-31 18:37:38 · 470 阅读 · 0 评论