标签:
function Persion() {
this.items = [];
this.click = function(f){
for(var i =0; i< this.items.length ;i++){
this.items[i].click = f;
}
this.click = f;
};
}
var p1 = new Persion();
var p2 = new Persion();
var p = new Persion();
p.items.push(p1);
p.items.push(p2);
p.click(function() {
console.log("sss");
});
标签:
原文地址:http://www.cnblogs.com/hsha/p/4625696.html