摘要: 一、Element类型: nodeType: 1; nodeName: 元素名; nodeValue: null; parentValue: Document 或者 Element; var oDiv = document.getElementById("example"); alert(oDiv.tagName);//"DIV" alert(oDiv.nodeName);//"DIV" ale... 阅读全文
posted @ 2016-05-02 21:43 jweboy 阅读(181) 评论(0) 推荐(0)
摘要: 一、Document类型 nodeType: 9; nodeName: ”#document”; nodeValue: null; parentValue: null; ownerDocumet: null. 其他浏览器(除IE)可以访问Document的构造函数与原型; 所有浏览器 (包括IE8 +)访问 HTMLDocument 的构造函数与原型; var html = document.do... 阅读全文
posted @ 2016-04-27 19:30 jweboy 阅读(161) 评论(0) 推荐(0)
摘要: 一、DOM1级定义了一个Node接口,这个接口是由DOM中的所有节点类型实现的。Node接口共有12种节点类型,常见的是元素节点、文本节点和文档节点。 Node.ELEMENT_NODE(1);——元素节点 Node.Text_NODE(3);——文本节点 Node.DOCUMENT_NODE(9) 阅读全文
posted @ 2016-04-26 20:52 jweboy 阅读(394) 评论(0) 推荐(0)
摘要: function hasClass(elem, cls) { cls = cls || ''; if (cls.replace(/\s/g, '').length == 0) return false; //当cls没有参数时,返回false return new RegExp(' ' + cls + ' ').test(' ' + elem.className + ' '... 阅读全文
posted @ 2016-04-26 20:20 jweboy 阅读(685) 评论(0) 推荐(0)