how to select which doesn't has an input child

how to select which doesn't has an input child

I try to use .not(children('input')) to select which doesn't has an input child, but it doesn't work.


  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="js/jquery-1.4.2.min.js"></script> 
  5. </head>
  6. <body>
  7. <table width="100%" border="1">
  8. <thead>
  9. <tr>
  10. <td>
  11. <input type="checkbox" id="chk_del">
  12. </td>
  13. <td colspan="2">
  14. </td>
  15. </tr>
  16. </thead>

  17. <tbody>
  18. <tr>
  19. <td>
  20. <input type="checkbox" id="del[]" value="del1">
  21. </td>
  22. <td>alert</td>
  23. <td>alert
  24. </td>
  25. </tr>
  26. <tr>
  27. <td>
  28. <input type="checkbox" id="del[]" value="del2">
  29. </td>
  30. <td>alert
  31. </td>
  32. <td>alert
  33. </td>
  34. </tr>
  35. </tbody>

  36. <tfoot>
  37. </tfoot>
  38. </table>
  39. </body>
  40. <script>
  41. $('#chk_del').change(function()
  42. { $("tbody > tr > td > input:checkbox").attr('checked', $('#chk_del').is(':checked'));
  43. });

  44. $('tbody > tr > td').not(children('input')).click(function()
  45. { alert('doesnt has an input child');
  46. });
  47. </script>
  48. </html>