簡體   English   中英

jquery隱藏顯示表td

[英]jquery hide show table td

如果我的班級確實滿足輸入字段請建議我想隱藏所有(TD)

<tr>
    <th>Rm</th>
        <td class="CorriderTmp">CorriderTmp </td>

        <td class="Tem">TemBalcony3 </td>

        <td class="Balp New ">BalconyTmp New  </td>

        <td class="BalconyTmp New ">BalconyTmp New  </td>

        <td class="hmmm test">hmmm test </td>

        <td class="Template Via Name">Template Via Name </td>

        <td class="Bar Test Template">Bar Test Template </td>

        <td class="na">na </td>

        <td class="nas">na </td>



</tr>

$("#searchtemplate").click(function(){
    var getfilterrecord = $("#filterrecord").val(); // get the data after type
    if(getfilterrecord == "CorriderTmp"){
        $(".CorriderTmp").show();
    }
});

我想在輸入值后隱藏所有數據,除了滿足類之外的所有數據如何使用 jquery

$("#searchtemplate").click(function() {
    var getfilterrecord = $("#filterrecord").val(); 
    $("table td").hide();
    $("."+getfilterrecord).show();
});

像下面這樣的東西,隱藏所有並再次顯示它們。 雖然你的 HTML 沒有多大意義.....

$("#searchtemplate").click(function(){    
     $("table td").hide();
     $("." + $("#filterrecord").val()).show();        
});

看到這個小提琴

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM