title: Call function in javascript file from html onclick event
body: <p>This has been driving me crazy- I can't figure out why it wont work! </p>
  
  <p>I have two files: myPage.html and myCode.gs in google scripts. I have deployed the html file as a web app, and I want the onclick event for the submit button to trigger the emailTech function from the myCode.gs file but it won't work! When I run the function straight from the file, it works fine. </p>
  
  <p>I've done a few hours of research and tried to add <code>&lt;script type="text/javascript" src="myCode.gs"&gt;&lt;/script&gt;</code> but that causes an error when I refresh the web app. I have tried calling the function in the onClick event as <code>onClick= "google.script.run.emailTech()"</code> and <code>onClick= "emailTech()"</code> but neither work. I have also tried loading the emailTech function into the script tag in the header, but that didn't work either! What am I missing? Please help! </p>
  
  <p>myPage.html file:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;&lt;/script&gt;
      &lt;body&gt;
      &lt;input type="submit" onclick="emailTech();" value="Submit" /&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>myCode.gs file:</p>
  
  <pre><code>    function doGet() {
    return HtmlService.createHtmlOutputFromFile('myPage');
  }
  
  function emailTech(){
  
    Logger.log("is this firing?");
    var message = "This is the email message";
    MailApp.sendEmail("XYZ@abc.com", "This is the subject", message );
  
  }
  </code></pre>