jQuery: Hide parent <td> if contains child <input> with specific class? -


i'm working jquery tablesorter filters plugin , i'm trying hide <td>. i'm looking do:

-if <td> contains <input class="tablesorter-filter disabled">, hide parent <td>

<tr class="tablesorter-filter-row">     <td>         <input class="tablesorter-filter">     </td>      <td>         <input class="tablesorter-filter disabled">     </td>      <td>         <input class="tablesorter-filter">     </td> </tr>  <script>     jquery(function ($) {         $(".tablesorter-filter-row td").filter(function(i) { return $(this).find("> input.disabled").length > 0 }).hide();     }); </script> 

that jquery culled issue had, it's not hiding parent td in instance.

your code fine. make sure in dom ready handler , should work fine.

$(function() {    $(".tablesorter-filter-row td").filter(function() {          return $('input', this).hasclass('disabled');     }).hide(); }); 

check fiddle


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -