title: How to fire a DOM event with YUI3
body: <p>I've encountered an annoying issue while working on YUI.</p>
  
  <p>I have a main area and a navigation block. The elements in the main area can be activated with a direct click or by clicking an element in the navigation block that triggers the appropriate  element in the main area.</p>
  
  <p>As it turns out, triggering a click event programmatically in YUI isn't as simple as I thought it might be. Looking at the documentation I found pleanty of information on how to attach and delegate events but not how to call one.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/19363280/yui3-how-would-i-trigger-an-event">this question</a>, but it deals with creating a new custom event and not calling an existing one.</p>
  
  <p>All other similar questions are answered with using <em>.simulate()</em>, but this is actually not the best option for compatability reasons and it's also not recommended by YAHOO itself for client-side use <a href="http://yuilibrary.com/yui/docs/event/simulate.html#faking" rel="nofollow noreferrer">http://yuilibrary.com/yui/docs/event/simulate.html#faking</a>. <strong>EDIT:</strong> After re-reading the section I realized the warning is irrelevant for the subject of this question.</p>
  
  <p>I found a solution by calling the <em>click()</em> command in the node's DOM element, but this is really a last resort and I would like to know if there's a more "clean" way to do it through YUI.</p>
  
  <p>Here is an example of what I'm doing now: <a href="http://jsfiddle.net/3fso2dg8/" rel="nofollow noreferrer">http://jsfiddle.net/3fso2dg8/</a></p>
  
  <p>In the example, the second button is triggering the click event of the first button by using the DOM element</p>
  
  <pre><code>Y.one('#clickme')._node.click();
  </code></pre>
  
  <p><strong>CONCLUSIONS</strong></p>
  
  <p>After more fiddling with the code I came to realize <em>simulate()</em> is the preferred option in most cases, but not all.</p>
  
  <p>The YUI vesrion I'm required to work with (3.14) has a known issue on simulating a click event in IE9 and above. Since - for other technical reasons - I cannot upgrade to whatever version this issue was fixed and I need to keep a multi-platform compatibility, my original solution is still the best option. Anyone else that uses YUI components that don't respond well on IE, maybe you stumbled upon the same issue so this is one way to solve it.</p>