Trigger an click event with parameters
<p>I have an click function and want to trigger it outside of the function with params.</p>

<pre><code>&lt;div id="menubar"&gt;
    &lt;a id="menu_file_open"&gt;File Open&lt;/a&gt;
    &lt;a id="menu_file_save"&gt;Save File&lt;/a&gt;
&lt;/div&gt;


$("#menubar a").click(function(event){

    var menu_item = $(this).attr('id');
    var $context = $(this);

    switch(menu_item){

        case 'menu_file_open':
             //Do menu file open dialog
        break;

        case 'menu_file_save': break;

    }

});

$('#menubar a').trigger('click'); //not working (ID,context not defined);
</code></pre>

<p>How would I pass in the ID and the context of the div as it was actually clicked.</p>
