title: Tampermonkey .click() not working
body: <p>I'm trying to auto click a button in tampermonkey, but for some reason the code isn't executing. Though, if I put the code in console and run it, it works fine.</p>
  
  <p>Here it is:</p>
  
  <pre><code>$(document).ready(function() {
      path = window.location.pathname;
      setTimeout(autoTraderReady, 10);
      $('#VehicleApplyButton').click();
  });
  &lt;table id="VehicleApplyButton" class="x-btn va-apply-button x-btn-noicon x-column" cellspacing="0"&gt;&lt;tbody class="x-btn-small x-btn-icon-small-left"&gt;&lt;tr&gt;&lt;td class="x-btn-tl"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;td class="x-btn-tc"&gt;&lt;/td&gt;&lt;td class="x-btn-tr"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="x-btn-ml"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;td class="x-btn-mc"&gt;&lt;em class=" x-unselectable" unselectable="on"&gt;&lt;button class=" x-btn-text" id="ext-gen147" type="button"&gt;&amp;nbsp;&lt;/button&gt;&lt;/em&gt;&lt;/td&gt;&lt;td class="x-btn-mr"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="x-btn-bl"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;td class="x-btn-bc"&gt;&lt;/td&gt;&lt;td class="x-btn-br"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
  </code></pre>
  
  <p>Button does not switch dynamically, tried doing an alert when the function runs, doesn't alert me.</p>