<html>
<head>
<script>
$( "#test1" ).click(function() {
$(this).next("#test2").slideToggle( "slow", function() {
// Animation complete.
});
});
</script>
</head>
<body>
<table>
<tr>
<th>Actions</th>
</tr>
<tr>
<td>
<input type="submit" name="test1" id="test1" value="TEST1" />
<br/>
<input style="display: none;" type="submit" name="test2" id="test2" value="TEST2" /><br/>
</td>
</tr>
<tr>
<td>
<input type="submit" name="test1" id="test1" value="TEST1" /><br/>
<input style="display: none;" type="submit" name="test2" id="test2" value="TEST2" /><br/>
</td>
</tr>
</table>
</body>
</html>
嗨,我想在单击表中的test1按钮后显示或隐藏test2按钮(在选定行中)。但有个问题是有几个按钮
具有相同的id。是否可以显示或隐藏选定的按钮?你能帮助我吗?提前谢谢你!