方法的链式调用: (function() { //私有类 function _$ (els) { this.elements = []; for(var i = 0, len = els.length; i < len; ++i){ var element = els[i]; if(typeof element === 'string'){ element = document.getElementById(element); } this.elements.push(element); } }…