我有一个在表 td 中附加 2 个文本字段和一个按钮的按钮,但是问题是附加按钮的 onclick 功能不会触发。有人看到问题了吗?代码:
<script>
$(document).ready(function(){
$("#add").click(function() {
$(".no_border").append("<br /><label>Co-author email:</label><input type='text' name='author_email'/><label>Co-author Level:</label><input type='text' name='author_level'/><input id='save' type='button'name='save' value='Add'/>");
});
});
</script>
<?php
while($row = mysql_fetch_assoc($co_authors)) {
echo "<tr>
<td>{$row['author_email']}</td>
<td>{$row['coauthor_level']}</td>";
?><td><button class='remove' id='remove' name='remove' email="<?php echo $row['author_email'] ?>"
paper="<?php echo $row['paper_id'] ?>">Remove</button></td>
</tr><?
?><td colspan="3" class="no_border"><button class="add" name="add"></button>
<label id="add" class="cursor_pointer"> Add more co-authors</label></td><?
}
?>