1 function $(selector){ 2 return new O(document.getElementById(selector)); 3 } 4 function O(ele){ 5 this.ele=ele; 6 } 7 O.prototype.show=function(){ 8 this.ele.style.display=‘‘; 9 return this; 10 }; 11 O.prototype.hide=function(){ 12 this.ele.style.display=‘none‘; 13 return this; 14 }; 15 $(‘#id‘).show().hide();
时间: 2024-10-29 19:09:00