title: onclick function runs automatically
body: <p>Using google apps script I'm having trouble running a js function which passes parameters. When I add the parameters it will always run the code when the page loads instead of when the button is clicked.</p>
  
  <p>Direct from the HtmlService example, it is OK - it runs when the button is pressed...</p>
  
  <pre><code>document.getElementById('button1').onclick = doSomething;
  </code></pre>
  
  <p>But when I add a parameter to the call (and function) as below, it runs just once when the page loads (and not when the button is pressed)...</p>
  
  <pre><code>document.getElementById('button1').onclick = doSomething('with_this_parameter');
  </code></pre>
  
  <p>Any insight into this behaviour would be greatly appreciated... sorry if the answer is obvious!</p>