摘要: / 城市 学校 /下拉列表联动事件 city.onchange = function () { //selectedIndex返回被选中的option的index. //.text 返回option中的文本值 var text = this.children[th... 阅读全文
posted @ 2017-11-12 21:22 对三 阅读(1426) 评论(0) 推荐(0) 编辑
摘要: onchange 事件会在域的内容改变时发生。 onchange 事件也可用于单选框与复选框改变后触发的事件。 阅读全文
posted @ 2017-11-12 21:18 对三 阅读(1446) 评论(0) 推荐(0) 编辑
摘要: 方法1: 方法2: 方法3: 方法4: 方法5: 阅读全文
posted @ 2017-11-12 12:46 对三 阅读(166529) 评论(0) 推荐(0) 编辑
摘要: //判断容器当前有没有子级元素,如果没有直接appendChild就行了; if (p.children[0]) { p.insertBefore(span, p.children[0]); } else { p.appendChild(span); } 阅读全文
posted @ 2017-11-11 16:22 对三 阅读(828) 评论(0) 推荐(0) 编辑
摘要: p.appendChild(span); 阅读全文
posted @ 2017-11-11 16:20 对三 阅读(410) 评论(0) 推荐(0) 编辑
摘要: p.removeChild(p.children[0]); 阅读全文
posted @ 2017-11-11 16:17 对三 阅读(356) 评论(0) 推荐(0) 编辑
摘要: p.replaceChild(nodeNext, p.children[j]); p.replaceChild(nodePrev, p.children[j + 1]); 阅读全文
posted @ 2017-11-11 16:14 对三 阅读(279) 评论(0) 推荐(0) 编辑
摘要: var nodePrev = p.children[j].cloneNode(true); var nodeNext = p.children[j + 1].cloneNode(true); 阅读全文
posted @ 2017-11-11 16:12 对三 阅读(213) 评论(0) 推荐(0) 编辑
摘要: function getStyle(ele, attr) { return ele.currentStyle ? ele.currentStyle[attr] : window.getComputedStyle(ele, null)[attr]; } 阅读全文
posted @ 2017-11-11 16:10 对三 阅读(143) 评论(0) 推荐(0) 编辑
摘要: p.onclick = function (event) { var e = event || window.event, target = e.target ? e.target : e.srcElement; if (target.tagName === 'SPAN') { p.removeChild(target... 阅读全文
posted @ 2017-11-11 09:56 对三 阅读(205) 评论(0) 推荐(0) 编辑