for(key in attr){ //key:属性名 //attr[key]:属性值 } 转载于:https://www.cnblogs.com/wanlibingfeng/p/10070080.html