title: Passing jQuery.show() & jQuery.hide() as parameter to be applied on an element
body: <p>As the title reads, I'd like to pass show() &amp; hide() jQuery functions as parameters in another function.</p>
  
  <pre><code>function applyActionOnClass(attr, action) {
      $('#salesonhold_table tr').each(function () {
      if ($(this).attr('status') == attr)
          $(this).action;
      });
  }
  </code></pre>
  
  <p>Here is when I call my <code>applyActionOnClass</code> function:</p>
  
  <pre><code>$(document).on('change', '.checkboxes', function () {
      var attr = $(this).val();
      if ($(this).is(':checked'))
          applyActionOnClass(attr, show());
      else
          applyActionOnClass(attr, hide());
  });
  </code></pre>
  
  <p>To explain a bit the purpose of this, I have a table and each of its <code>&lt;tr&gt;</code> has a <code>status</code> attribute which differs them from each other. I have two checkboxes on top of the table, one for each possible <code>status</code> value and I'd like to hide/show corresponding <code>&lt;tr&gt;</code> when checkboxes are triggered.</p>
  
  <p>The trigger and stuff work fine but when it comes to <code>$(this).action;</code> it says <code>hide is not defined</code>. Any idea what I did wrong there?</p>
  
  <p>Thank you so much !</p>