先来看一段代码:

var dom = document.querySelector('body');
for(var i in dom){
console.log(i,dom[i])
}

可以看到很多,来整理一下,总共有三大类(我自己分的,没有科学依据)

除了一些私有属性、方法(比如a的私有属性href等)和一些空的属性

  1. attributes

  2. events

  3. methods


attributes

根据value类型又分为了几个小分类:

1.普通属性

text
link
vLink
aLink
title
lang
translate true
dir
hidden false
tabIndex -1
accessKey
draggable false
spellcheck true
contentEditable inherit
isContentEditable false
innerText
images
Features
outerText
webkitdropzone
namespaceURI http://www.w3.org/1999/xhtml
prefix null
innerHTML
outerHTML
shadowRoot null
baseURI
isConnected true
baseURI http://192.168.1.86/bootstrap/index.html?#1
isConnected true
nodeValue null
textContent

2.样式属性

bgColor
background
offsetTop 0
offsetLeft 0
offsetWidth 1333
offsetHeight 50
scrollTop 0
scrollLeft 0
scrollWidth 1333
scrollHeight 950
clientTop 0
clientLeft 0
clientWidth 1333
clientHeight 50

3.dom操作属性

offsetParent null
localName body
tagName BODY
previousElementSibling
nextElementSibling
children
firstElementChild
lastElementChild
childElementCount
nodeType 1
nodeName BODY
ownerDocument #document
parentNode
parentElement
childNodes
firstChild
lastChild
previousSibling
nextSibling null

4.其他对象属性

style CSSStyleDeclaration {}
dataset DOMStringMap {}
attributes NamedNodeMap {length: 0}

5.我不知道的类型

ELEMENT_NODE 1
ATTRIBUTE_NODE 2
TEXT_NODE 3
CDATA_SECTION_NODE 4
ENTITY_REFERENCE_NODE 5
ENTITY_NODE 6
PROCESSING_INSTRUCTION_NODE 7
COMMENT_NODE 8
DOCUMENT_NODE 9
DOCUMENT_TYPE_NODE 10
DOCUMENT_FRAGMENT_NODE 11
NOTATION_NODE 12
DOCUMENT_POSITION_DISCONNECTED 1
DOCUMENT_POSITION_PRECEDING 2
DOCUMENT_POSITION_FOLLOWING 4
DOCUMENT_POSITION_CONTAINS 8
DOCUMENT_POSITION_CONTAINED_BY 16
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC 32

events

onbeforecopy null
onbeforecut null
onbeforepaste null
oncopy null
oncut null
onpaste null
onsearch null
onselectstart null
onwheel null
onwebkitfullscreenchange null
onwebkitfullscreenerror null
onblur null
onerror null
onfocus null
onload null
onresize null
onscroll null
onbeforeunload null
onhashchange null
onlanguagechange null
onmessage null
onoffline null
ononline null
onpagehide null
onpageshow null
onpopstate null
onstorage null
onunload null
onorientationchange null
onrejectionhandled null
onunhandledrejection null
onabort null
oncancel null
oncanplay null
oncanplaythrough null
onchange null
onclick null
onclose null
oncontextmenu null
oncuechange null
ondblclick null
ondrag null
ondragend null
ondragenter null
ondragleave null
ondragover null
ondragstart null
ondrop null
ondurationchange null
onemptied null
onended null
oninput null
oninvalid null
onkeydown null
onkeypress null
onkeyup null
onloadeddata null
onloadedmetadata null
onloadstart null
onmousedown null
onmouseenter null
onmouseleave null
onmousemove null
onmouseout null
onmouseover null
onmouseup null
onmousewheel null
onpause null
onplay null
onplaying null
onprogress null
onratechange null
onreset null
onseeked null
onseeking null
onselect null
onshow null
onstalled null
onsubmit null
onsuspend null
ontimeupdate null
ontoggle null
onvolumechange null
onwaiting null
ontouchcancel null
ontouchend null
ontouchmove null
ontouchstart null

methods

click click() { [native code] }
focus focus() { [native code] }
blur blur() { [native code] }
hasAttributes hasAttributes() { [native code] }
getAttribute getAttribute() { [native code] }
getAttributeNS getAttributeNS() { [native code] }
setAttribute setAttribute() { [native code] }
setAttributeNS setAttributeNS() { [native code] }
removeAttribute removeAttribute() { [native code] }
removeAttributeNS removeAttributeNS() { [native code] }
hasAttribute hasAttribute() { [native code] }
hasAttributeNS hasAttributeNS() { [native code] }
getAttributeNode getAttributeNode() { [native code] }
getAttributeNodeNS getAttributeNodeNS() { [native code] }
setAttributeNode setAttributeNode() { [native code] }
setAttributeNodeNS setAttributeNodeNS() { [native code] }
removeAttributeNode removeAttributeNode() { [native code] }
closest closest() { [native code] }
matches matches() { [native code] }
webkitMatchesSelector webkitMatchesSelector() { [native code] }
getElementsByTagName getElementsByTagName() { [native code] }
getElementsByTagNameNS getElementsByTagNameNS() { [native code] }
getElementsByClassName getElementsByClassName() { [native code] }
insertAdjacentElement insertAdjacentElement() { [native code] }
insertAdjacentText insertAdjacentText() { [native code] }
insertAdjacentHTML insertAdjacentHTML() { [native code] }
createShadowRoot createShadowRoot() { [native code] }
getDestinationInsertionPoints getDestinationInsertionPoints() { [native code] }
requestPointerLock requestPointerLock() { [native code] }
getClientRects getClientRects() { [native code] }
getBoundingClientRect getBoundingClientRect() { [native code] }
scrollIntoView scrollIntoView() { [native code] }
scrollIntoViewIfNeeded scrollIntoViewIfNeeded() { [native code] }
animate animate() { [native code] }
remove remove() { [native code] }
webkitRequestFullScreen webkitRequestFullScreen() { [native code] }
webkitRequestFullscreen webkitRequestFullscreen() { [native code] }
querySelector querySelector() { [native code] }
querySelectorAll querySelectorAll() { [native code] }
hasChildNodes hasChildNodes() { [native code] }
normalize normalize() { [native code] }
cloneNode cloneNode() { [native code] }
isEqualNode isEqualNode() { [native code] }
isSameNode isSameNode() { [native code] }
compareDocumentPosition compareDocumentPosition() { [native code] }
contains contains() { [native code] }
lookupPrefix lookupPrefix() { [native code] }
lookupNamespaceURI lookupNamespaceURI() { [native code] }
isDefaultNamespace isDefaultNamespace() { [native code] }
insertBefore insertBefore() { [native code] }
appendChild appendChild() { [native code] }
replaceChild replaceChild() { [native code] }
removeChild removeChild() { [native code] }
addEventListener addEventListener() { [native code] }
removeEventListener removeEventListener() { [native code] }
dispatchEvent dispatchEvent() { [native code] }

下一节详细分析

最新文章

  1. Entity Framework Code First实体对象变动跟踪
  2. 代码生成工具——Entity Framework Power Tools
  3. week7团队项目体会
  4. CodeForces Round #301 Div.2
  5. android websocket推送
  6. Error: no `server' JVM at...解决办法 【转】
  7. ACM HDU 2674 N! Again(数论)
  8. hdu4348 - To the moon 可持久化线段树 区间修改 离线处理
  9. 一个模拟时钟的时间选择器 ClockPicker
  10. Linux CentOS 7 YouCompleteMe相关配置。
  11. 想使用Docker容器?先看看这些注意事项
  12. python项目依赖管理分享迁移后重建开发环境(一)virtualenv 和 pip
  13. go 并发编程(2)
  14. chrome恢复默认搜索引擎为Google
  15. Spring Boot 2 (十):Spring Boot 中的响应式编程和 WebFlux 入门
  16. 【java+selenium】网易云音乐刷累计听歌数
  17. es6基础知识总结(附加)
  18. python排列组合之itertools模块
  19. mysql 原理 ~ checkpoint
  20. HDOJ1024--Max Sum Plus Plus(动态规划)UnSolved

热门文章

  1. vue项目npm run dev 报错error in ./src/main.js Module build failed: ReferenceError: Unknown plugin "transform-vue-jsx" specified in......
  2. 积分图(二) - Block - Match(统计)滤波器
  3. ASP.NET Core 6框架揭秘实例演示[18]:HttpClient处理管道
  4. CSS简介,基础选择器,字体属性,文本属性
  5. 1.java连接pulsar服务
  6. Python:pyglet学习(1):想弄点3D,还发现了pyglet
  7. think php 未登录,禁止访问页面 + 退出登录
  8. Centos8 下部署 ASP.net Core 程序
  9. 使用 AHK 在 VS Code 中根据上下文自动切换输入法状态
  10. 【面经】MyBatis常见面试问题