title: Click a button element on page load
body: <p>I'm trying to auto-click a button to initiate a function when the html page loads. I've tried <code>document.getElementById('watchButton').click</code> and it doesn't seem to work, the button is not clicked. Any suggestions? </p>
  
  <pre><code>&lt;div class="content"&gt;
          &lt;div class="action-area ch30"&gt;
              &lt;button class="button dh" id="watchButton"&gt;Start Geolocation Watch&lt;/button&gt;
              &lt;button class="button dh" id="refreshButton" &gt;Refresh Geolocation&lt;/button&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The javascript:</p>
  
  <pre><code>    run:function() {
      var that = this;
      document.getElementById("watchButton").addEventListener("click", function() {
          that._handleWatch.apply(that, arguments);
      }, false); 
      document.getElementById("refreshButton").addEventListener("click", function() {
          that._handleRefresh.apply(that, arguments);
      }, false);
  },
  </code></pre>
  
  <p>Thanks!</p>