How to pass parameters form trigger event to a triggered event in Jquery?
<p>I am trying to pass parameters form 'trigger' event to the triggered event 'click' in Jquery. <a href="http://api.jquery.com/trigger/#trigger-eventType-extraParameters" rel="nofollow noreferrer">Jquery documentation</a> says that you can pass external parameters in an array 'extraParameters'. However, I don't know who to receive those parameters in the triggered event. 'click' in my case.</p>
<p>The code that I am using to pass parameters in the trigger event is like the following:</p>
<pre><code>$(&quot;#add_docs&quot;).trigger(&quot;click&quot;, [request_id]);
</code></pre>
<p>The code that I am using to get the parameters form the 'trigger' event in my 'click' event is like the following:</p>
<pre><code>$(&quot;#add_docs&quot;).click(params, function () { console.log(params[0]) });
</code></pre>
<p>There is wrong with the way that I am trying to get the params. I need a little help here please.</p>