title: Trigger the click JS code on page load through JQuery
body: <p>I am running following code on a link:-</p>
  
  <pre><code>$('#expertprofiles-category-filters .filterby &gt; a').on("click", function () {
      // Figure out which category to show.
      var categoryId = $(this).attr('rel');
  
      // Hide the other subfilters.
      $("div.category-panel[rel!=" + categoryId + "]").slideUp(100);
  
      // Show the subfilters of the category.
      $("div.category-panel[rel=" + categoryId + "]").delay(100).slideDown(400);
  });
  </code></pre>
  
  <p>This code runs fine but the problem is that I want to run this code on page load too, so that any one link is autaomatically selected.</p>
  
  <h2>I tried this:-</h2>
  
  <pre><code>$("#expertprofiles-category-filters .filterby").find('a').trigger('click');
  </code></pre>
  
  <p>But it doesn't work ...</p>
  
  <p>Thanks.</p>