<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>