我有一个包含很多表格行的表格<tr>。
每个<tr>作为 abutton和 a link。
这是我的一些代码
<form name="mycart" id="mycart" action="library/cartactivity.php?action=update" method="post">
<table cellspacing="0">
<tr id="cart-list" onClick="document.location.href='index.php'">
<td><button onclick="location.href='library/stockactivity.php';">Remove</button></td>
</tr>
</table>
<input type="submit" value="submit"/>
</form>
我的问题是当我点击<button>它加载<input type="submit">链接
但是,我将代码更改为
<form name="mycart" id="mycart" action="library/cartactivity.php?action=update" method="post">
<table cellspacing="0">
<tr id="cart-list" onClick="document.location.href='index.php'">
<td><input type="button" onclick="location.href='library/stockactivity.php';" value="Remove" /></td>
</tr>
</table>
<input type="submit" value="submit"/>
</form>
(我<button>改为<input type="button">)
我的问题是当我点击<input type="button">它加载<tr>链接
有什么解决办法吗?