<td>
<input type="text" name="eee0" value="xxxx">
<input type="button" id="0" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<td>
<input type="text" name="eee1" value="gggg">
<input type="button" id="1" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<script>
function rrrrrr(RebaID)
{
var aa= 'eee'+RebaID;
alert(document.getElementsByName(aa)[0].value) ;//也得不到,怎么解决?
}
</script>
<input type="text" name="eee0" value="xxxx">
<input type="button" id="0" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<td>
<input type="text" name="eee1" value="gggg">
<input type="button" id="1" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<script>
function rrrrrr(RebaID)
{
var aa= 'eee'+RebaID;
alert(document.getElementsByName(aa)[0].value) ;//也得不到,怎么解决?
}
</script>
<head>
<title>HTML表示</title>
<td>
<input type="text" name="eee0" value="xxxx">
<input type="button" id="0" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<td>
<input type="text" name="eee1" value="gggg">
<input type="button" id="1" onClick="javascript:rrrrrr(this.id)" value="edit">
</td>
<script>
function rrrrrr(RebaID)
{
var aa= 'eee'+RebaID;
alert(document.getElementsByName(aa)[0].value)
}
</script>
</html>是你环境有问题,我这里跑得很正常