87,910
社区成员
发帖
与我相关
我的任务
分享
<?php
/*
* Created on 2013-11-28
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
?>
<script type="text/javascript" >
function test(obj){
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<table name="t1">
<tr>
<input type="submit" name="submit" onclick="test(this)"/>
<input type="text" id="text" name="text" value=""/>
</tr>
</table>
<table name="t1">
<tr>
<input type="text" id="text" name="text" value=""/>
<input type="submit" name="submit" onclick="test(this)"/>
</tr>
</table>
<table name="t1">
<tr>
<input type="text" id="text" value=""/>
<input type="submit" name="submit" name="text" onclick="test(this)"/>
</tr>
</table>
</body>
</html>
function test(obj){
var elem = obj.parentNode.getElementsByName("test").item(0);
}