title: how to get AppleScript and jQuery to fire a '.click()' event in Safari
body: <p>I am trying to get some javascript code, with jQuery loaded in an AppleScript, to fire a '.click()' event.</p>
  
  <p>Here's a look at the code in question:</p>
  
  <pre><code>var dayIdValue1 = 'z_event_date_picker_calendar_0_cell' + dayValue2;
  
  var dayTd = document.getElementById(dayIdValue1).childNodes[0];
  dayTd.click();
  </code></pre>
  
  <p>It's probably worth mentioning that I tried to get jQuery to load a selector with the variable dayIdValue1, but I couldn't get it to work without an error.</p>
  
  <p>Also it's worth adding, that I am using Safari to run the script, but it keeps firing an error like this:</p>
  
  <pre><code>TypeError: 'undefined' is not a function (evaluating 'dayTd.click()')
  </code></pre>
  
  <p>Any help you would have to offer on the matter would be helpful.</p>
  
  <p>Thanks in advance.</p>