<!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">
function disabled(){
// var t=document.getElementById("t");
var input=document.getElementsByTagName("input");
for(var i=0;i<input.length;i++){
if(input[i].type=="text"){
input[i].disabled=true;
input[i].style.backgroundColor="#eeeeee";
}
}
}
function edit(n){
var t=document.getElementById("t"+n);
var input=t.getElementsByTagName("input");
for(var i=1;i<input.length-1;i++){
input[i].disabled=false;
input[i].style.backgroundColor="transparent";
}
input[1].focus();
}
</script>
</head>
<body οnlοad="disabled()">
<form name="myform">
<table border="0" width="80%" id='t1'>
<tr>
<td align="center"> </td>
<td height="20" align="center">语文</td>
<td height="20" align="center">数学</td>
<td height="20" align="center">英语</td>
<td height="20" align="center">社会</td>
<td height="20" align="center">科学</td>
<td height="20" align="center">体育</td>
<td height="20" align="center">总分</td>
</tr>
<tr>
<td align="center"><input type="button" name="button" id="button" value="编辑" οnclick="edit(1)"/></td>
<td height="20" align="center"><input type="text" name="score1" size="4"></td>
<td height="20" align="center"><input type="text" name="score2" size="4"></td>
<td height="20" align="center"><input type="text" name="score3" size="4"></td>
<td height="20" align="center"><input type="text" name="score4" size="4"></td>
<td height="20" align="center"><input type="text" name="score5" size="4"></td>
<td height="20" align="center"><input type="text" name="score6" size="4"></td>
<td height="20" align="center"><input type="text" name="scoretotal" id="scoretotal" size="4"></td>
</tr>
</table>
<table border="0" width="80%" id='t2'>
<tr>
<td align="center"> </td>
<td height="20" align="center">语文</td>
<td height="20" align="center">数学</td>
<td height="20" align="center">英语</td>
<td height="20" align="center">社会</td>
<td height="20" align="center">科学</td>
<td height="20" align="center">体育</td>
<td height="20" align="center">总分</td>
</tr>
<tr>
<td align="center"><input type="button" name="button" id="button" value="编辑" οnclick="edit(2)"/></td>
<td height="20" align="center"><input type="text" name="score1" size="4"></td>
<td height="20" align="center"><input type="text" name="score2" size="4"></td>
<td height="20" align="center"><input type="text" name="score3" size="4"></td>
<td height="20" align="center"><input type="text" name="score4" size="4"></td>
<td height="20" align="center"><input type="text" name="score5" size="4"></td>
<td height="20" align="center"><input type="text" name="score6" size="4"></td>
<td height="20" align="center"><input type="text" name="scoretotal" id="scoretotal" size="4"></td>
</tr>
</table>
</form>
<span id="msg"></span>
</body>
</html>