0
我創建了一個過濾器,根據比較選定的值從表中刪除行。問題是我需要在用戶選擇不同的值後顯示刪除的行,但我不知道如何。 這是我的函數:顯示刪除後使用jQuery和下拉選擇行
$(document).ready(function() {
$("button").click(function() {
$("td").each(function(index, paragraph) {
$td = $(paragraph);
if ($td.html() === $('select[name=select1]').val()) {
$(this).parent("tr:first").remove(); }
});
});
,這是下拉菜單:
<select name="select1">
<option value="" disabled selected>user name</option>
<?php while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
<option value="<?php echo $line['user_name'];?>">
<?php echo $line['user_name'];?>
</option>
<?php } ?>
</select>
是否有辦法後select1
變化我可以返回刪除行的表?
這聽起來像你不想「刪除」行這麼多的「隱藏」他們。 – JRulle 2015-02-11 15:41:43