![这里写图片描述](https://img-blog.csdn.net/20170605160442450?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQva2FrYXhpRA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>实例</title>
</head>
<body>
<table>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder0"/></td>
<td>我是右边<input type="text" id="penaltyorder0"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder1" onfocus="nopenaltyorder()"/></td>
<td>我是右边<input type="text" id="penaltyorder1" onfocus="penaltyorder()"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder2"/></td>
<td>我是右边<input type="text" id="penaltyorder2"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder3"/></td>
<td>我是右边<input type="text" id="penaltyorder3"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder4"/></td>
<td>我是右边<input type="text" id="penaltyorder4"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder5"/></td>
<td>我是右边<input type="text" id="penaltyorder5"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder6"/></td>
<td>我是右边<input type="text" id="penaltyorder6"/></td>
</tr>
<tr>
<td>我是左边<input type="text" id="nopenaltyorder7"/></td>
<td>我是右边<input type="text" id="penaltyorder7"/></td>
</tr>
</table>
<script>
function nopenaltyorder(){
var obj0=document.getElementById("nopenaltyorder0");
for(var i=0;i<8;i++){
var objs=document.getElementById("nopenaltyorder"+i);
objs.value=obj0.value;
}
}
function penaltyorder(){
var obj0=document.getElementById("penaltyorder0");
for(var m=0;m<8;m++){
var objs=document.getElementById("penaltyorder"+m);
objs.value=obj0.value;
}
}
</script>
</body>
</html>