<html>
<head>
<title>demo.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<script type="text/javascript">
function showPerson(p){
document.write('<p>姓名:<b>' + p.name + '</b></p>');
document.write('<p>年龄:<b>' + p.age + '</b></p>');
document.write('<p>教育经历:</p><ul>');
for(var i = 0; i < p.edus.length; i++){
document.write('<li>' + p.edus[i] + '</li>');
}
document.write('</ul>');
document.write('<p>所获奖励:</p><ul>');
for(var i=0; i< p.certs.length;i++){
document.write('<li>' + p.certs[i].year + '年:获得' + p.certs[i].content + '</li>');
}
document.write('/ul');
}
var person = {name:'小明',age : 20};
person.edus = ['云南第一小学','西安第二中学','北京第三高级中学'];
person.certs = [{year:1985,content:'奥林匹克数学小学竞赛一等奖'},
{year:1999,content:'市优秀少先队员'},
{year:2004,content:'优秀共青团员'}];
showPerson(person);
</script>
</head>
<body>
</body>
</html>