Open yzfdjzwl opened 4 years ago
if (someNode.nodeType == 1){ value = someNode.nodeName; } var firstChild = someNode.childNode[0] var secondChild = someNode.childNode.item[2] console.log(someNode.childNode.length) var returnedNode = someNode.appendChild(someNode.firsrChild) console.log(returnedNode == someNode.firstChild) console.log(returnedNode == someNode.lastChild)
举个例子
- jsDemo - index.html - js - index.js
创建一个jsDemo的git仓库,在index.html引入js/index.js
jsDemo
index.html
js/index.js