title: How to replace jQuery Event name with variables
body: <p>Is there a way to replace jQuery event name with variable like the following?
  If there is, how? If not, why?</p>
  
  <p>Thank you very much.
  The original code:</p>
  
  <pre><code>var menu = $('.menu');
  var search_bar = $('#search_bar');
  var bar = $('#bar');
  var icon = $('.myicon');
  
  search_bar.focusin(function(){
      search_bar.css('width','20%');
      menu.css('width','80%');
      bar.css('color', '#000);
      icon.css('color', '#000);
  });
  </code></pre>
  
  <p>The code I'd like to have:</p>
  
  <pre><code>function doSomething(tag, tagAction, actionAttributes) {
      if ((tag) &amp;&amp; (tagAction)) {
          $(tag).???tagAction(actionAttributes.key, actionAttributes.val);
      }
  }
  </code></pre>
  
  <p>???tagAction stands for 'css', is there a wildcard symbol that can replace event name, or I should have to use 'switch' to let the code below work correctly?</p>
  
  <pre><code>doSomething(".menu", "css", "{'width':'80%'}");
  </code></pre>