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(); });
Comments
Post a Comment