摘要: 1、正则声明: var reg = /abc/; var reg = new RegExp('abc'); 2、转义: \d:任何数字; \D:非数字; \w:字母,数字,下划线; \W:非字母,非数字,非下划线; \s:空格; \S:非空格 3、量词: {m,n}:大于等于m次,小于等于n次; { 阅读全文
posted @ 2017-05-14 23:35 我爱小明 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1、eleObj.addEventListener(eventName,handle,useCapture); eleObj:DOM元素; eventName:事件名称。注意,这里的事件名称没有“ on ”,如鼠标单击事件 click ,鼠标双击事件 doubleclick ,鼠标移入事件 mous 阅读全文
posted @ 2017-05-14 22:57 我爱小明 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1、 setAttribute():设置属性的值; getAttribute():得到属性的值; removeAttribute():移除属性; 2、offsetWidth:offsetWidth = width+padding+border; clientHeight:clientHeight = 阅读全文
posted @ 2017-05-14 22:40 我爱小明 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 1、childNodes:获取节点,不同浏览器表现不同; IE:只获取元素节点; 非IE:获取元素节点与文本节点; 解决方案:if(childNode.nodeName=="#text") continue 或者 if(childNode.nodeType != '3') continue 2、ch 阅读全文
posted @ 2017-05-14 21:58 我爱小明 阅读(16318) 评论(3) 推荐(5) 编辑