摘要: function Base() { //把返回的节点对象保存到一个Base 对象的属性数组里 this.elements = []; //获取id 节点 this.getId = function (id) { this.elements.push(document.getElementById(id)); return this; }; //获取name 节... 阅读全文
posted @ 2016-04-24 23:57 天桥残局 阅读(358) 评论(0) 推荐(0) 编辑
摘要: var Base = { //整个库可以是一个对象 getId : function (id) { //方法尽可能简短而富有含义 return document.getElementById(id); }, getName : function (name) { return document.getElementsByName(nam... 阅读全文
posted @ 2016-04-24 22:57 天桥残局 阅读(252) 评论(0) 推荐(0) 编辑