<!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title></title><style>*{padding:0;margin:0}#btn{width:80px;height:30px;border:1pxsolid#0094ff;background:#eee;line-height:30px;margin:10pxauto;text-align:center;cursor:pointer;}#clearbtn{width:80px;height:30px;border:1pxsolid#0094ff;background:#eee;line-height:30px;margin:10pxauto;text-align:center;cursor:pointer;}</style></head><body><script>vardefalt={'name':'小黄毛','six':'男','age':18}varpeople=function(){this.name=defalt.name;this.six=defalt.six;this.age=defalt.age;this.doHomeWrok=function(obj){obj=obj||"";varname=obj.name||this.name;varage=obj.age||this.age;varsix=obj.six||this.six;varoBox=document.getElementById('box');oBox.innerHTML='在下'+name+',性别'+six+',芳龄'+age;}}people.prototype.getAll=function(options){options=options||"";varname=options.name||this.name;varsix=options.six||this.six;varage=options.age||this.age;return'在下'+name+',性别'+six+',芳龄'+age;}varhulong=newpeople();varhl={'name':'大黄猫','six':'女','age':15}console.info(hulong.getAll(hl));functionclearDoHomeWrok(){varoBox=document.getElementById('box');oBox.innerHTML="";}</script><divid="btn"onclick="hulong.doHomeWrok(hl)">clickme</div><divid="clearbtn"onclick="clearDoHomeWrok()">clear</div><divid="box"></div></body></html>