摘要:
用DOM相关方法创建的留言板 1 2 3 10 11 无标题文档12 48 49 50 姓名:51 内容:52 53 54 55 56 阅读全文
摘要:
文档碎片可以他高DOM操作性能(主要针对插入:一次性插入大量元素) 1 2 3 4 无标题文档 5 21 22 23 24 25 26 27 阅读全文
摘要:
1 2 3 4 无标题文档 5 32 33 34 35 36 37 38 39 40 Document类型定义了创建Element和Text对象的方法,Node类型定义了在节点树中插入、删除和替换的方法。1 // 从指定的URL,异步加载和执行脚本2 function loadasync(url){3 var head = document.getElementsByTagName('head')[0]; //查找文档的标签4 var s = document.createElement('script'); //创建一个元素5 s.src = url; //. 阅读全文
摘要:
无标题文档 111隐藏 222隐藏 333隐藏 444隐藏同理children返回子节点。1 for(i=0;i<oUl.children.length;i++)2 {3 oUl.children[i].style.background='red';4 }nodeType:该节点的类型nodeValue:Text节点或Comment节点的文本内容(这两节点没有children属性)nodeName:元素的标签名,以大写形式表示 阅读全文
摘要:
1 2 3 4 5 11 12 13 14 11115 22216 33317 44418 19 20 阅读全文