1.重载

//重载(个数不同,类型不同)
function prop(){
var firstP = document.getElementById("p");
if(arguments.length == 1){
var temp = arguments[0];
for(p in temp){
firstP.style[p] = temp[p];
}
}else if(arguments,length == 2){
firstP.style[arguments[0]] = arguments[1];
}
}
prop({
"backgroundColor" : "red";
"fontsize" : "38px";
});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-18
  • 2021-11-20
相关资源
相似解决方案