title: how to get value of checkbox in Google Apps script
body: <p>I have created a checkbox in Google sheet sidebar which has a form with a checkbox field.</p>
  
  <p>Regardless of whether i check the checkbox or not, i get the value as "on".</p>
  
  <p>I need to know whether the checkbox was checked or not</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en" dir="ltr"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
              &lt;form&gt;
      &lt;div&gt;
      &lt;p&gt;
            &lt;label&gt;
              &lt;input name="item" id="Agree" type="checkbox" class="red"/&gt;
              &lt;span&gt;Agree&lt;/span&gt;
  
            &lt;/label&gt;
          &lt;/p&gt;
          &lt;/div&gt;
  
              &lt;div class="input-field col s12"&gt;
  
              &lt;button class="btn waves-effect waves-light" type="submit" name="action" id="btn"&gt;Generate
          &lt;i class="material-icons right"&gt;send&lt;/i&gt;
        &lt;/button&gt;
  
          &lt;/div&gt;
          &lt;/form&gt;
  
         &lt;script&gt;
  
                  var agreeValue = document.getElementById("Agree")
  
  
                  document.getElementById("btn").addEventListener("click", addRecord);
  
                  function addRecord() {
                  var data = {
                  agreeValue               : Agree.value
                  };
  
  
                  google.script.run.appendData(data);
                  }
  
  
  
  
  
      &lt;/script&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>