<html>
<head>
<script type="text/javascript">
function removeLink(i)
{
document.getElementById("tab2").deleteRow(i);
}
</script>
</head>
<body>
<form action="forth.php" method="post">
<table width="600" border="1" id="tab2">
<?php
foreach($_POST as $key => $post2)
{
?>
<tr>
<td>
<?php
echo $post2.'<br />';
?>
<input type="hidden" name="<?php echo $key;?>" value="<?php echo $post2;?>" />
</td>
<td><a href="#" onClick="removeLink(this.parentNode.parentNode.rowIndex);">Remove</a></td>
</tr>
<?php
}
?>
<tr>
<td><input type="submit" value="Next" /></td>
<td> </td>
</tr>
</table>
</form>
</body>
私のアンカータグがremoveLink()のonclick関数を持っているのを見ることができますが、期待どおりにtr全体を削除しません。アンカーが生成したリンクをクリックしても、アクションは実行されません。removeLink(this.parentNode.parentNode.rowIndex) で定義された内部オブジェクトをサポートしていないアンカーのような問題はありますか? みんなそれができる方法を助けます