<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function(){
var otab=document.getElementById(‘tab1‘);
var obtn=document.getElementById(‘btn1‘);
var oname=document.getElementById(‘name‘);
var oage=document.getElementById(‘age‘);
var id=otab.tBodies[0].rows.length+1;
obtn.onclick=function(){
var otr=document.createElement(‘tr‘);
var otd=document.createElement(‘td‘);
otd.innerHTML=id++;
otr.appendChild(otd);
var otd=document.createElement(‘td‘);
otd.innerHTML=oname.value;
otr.appendChild(otd);
var otd=document.createElement(‘td‘);
otd.innerHTML=age.value;
otr.appendChild(otd);
var otd=document.createElement(‘td‘);
otd.innerHTML=‘<a href="javascript:;">删除</a>‘;
otr.appendChild(otd);