saasbook

td_nth_child.js

Apr 2nd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. RP.filter_adult = function () {
  2. // 'this' is the element that received event (checkbox)
  3. if ($(this).is(':checked')) {
  4. $('#movies tbody tr').each(function() {
  5. // 'this' is each element being iterated over
  6. if (! /^G|PG$/i.test($(this).find('td:nth-child(2)').text())) {
  7. $(this).hide();
  8. }
  9. });
  10. } else {
  11. $('#movies tbody tr').show();
  12. }
  13. }
Add Comment
Please, Sign In to add comment