ben silme bir kullanıcı tıklama, sıranın arka plan değişecek ve satır sonra silecektir zaman bu nedenle bu jQuery işlevini kullanınjquery silmek tablo satırı
<table id="favoriteFoodTable">
<th>
Food Name:
</th>
<th>
Restaurant Name:
</th>
<th>
</th>
<?php while ($row = $foods->fetch()) {
?>
<tr>
<td>
<?php echo $row['foodName']; ?>
</td>
<td>
<?php echo $row['restaurantName']; ?>
</td>
<td>
<a class="deleteLink" href="" >delete</a>
</td>
</tr>
<?php } ?>
</table>
bir tablo var
$(document).ready(function() {
$("#favoriteFoodTable .deleteLink").on("click",function() {
var td = $(this).parent();
var tr = td.parent();
//change the background color to red before removing
tr.css("background-color","#FF3700");
tr.fadeOut(400, function(){
tr.remove();
});
});
});
sadece arkaplan değişiyor ama satır silinmiyor, neden? nasıl çözülür?
seçilebilir istiyorsanız http://codepedia.info/2015/02/remove-table-row-tr güzel bir makale -in-jquery/dinamik olarak eklenen tr –