title: How to pass javascript variable in google scriptlet?
body: <p>I have a code that looks like this.</p>
  
  <pre><code>&lt;script&gt;
  function loadmainTBL(){
   &lt;? var data = SpreadsheetApp
     .getActiveSpreadsheet().getSheetByName("Customer Logs Information Database")
     .getDataRange()
     .getValues(); ?&gt;
   var number = 6
  
   &lt;?for (var i = 12; i &lt; data.length; i++) { ?&gt;
   &lt;? if (data[i][0] == "I want to put it here") { ?&gt;
   var tableHeaderRowCount = 1;
   var table = document.getElementById('TableContainer');
   var rowCount = table.rows.length;
   for (var i = tableHeaderRowCount; i &lt; rowCount; i++) {
      table.deleteRow(tableHeaderRowCount);
   }
   &lt;?}?&gt;
   &lt;?}?&gt;
   }
  &lt;/script&gt;
  </code></pre>
  
  <p>as you can see this code is inside html file and it is compose of javascript and google scriptlet my question is this. how can I pass this?</p>
  
  <pre><code>var number = 6
  </code></pre>
  
  <p>in this one?</p>
  
  <pre><code>&lt;? if (data[i][0] == "I want to put it here") { ?&gt;
  </code></pre>
  
  <p>Here is the html code.</p>
  
  <pre><code>&lt;? var data = SpreadsheetApp
     .getActiveSpreadsheet().getSheetByName("Customer Logs Information Database")
     .getDataRange()
     .getValues(); ?&gt;
  
  &lt;table  id = "TableContainer" cellspacing="2" cellpadding="3" width ="100%" align = "center" class="hoverTable"&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;#&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Area&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Customer Name&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Person In Charge&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Remarks&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Status&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;font color="white"&gt;Doc. Date&lt;/font&gt;&lt;/th&gt;
     &lt;th  bgcolor = "darkgreen"&gt;&lt;/th&gt;
     &lt;? for (var i = 12; i &lt; data.length; i++) { ?&gt;
     &lt;tr&gt;
     &lt;td  class="dataid"&gt;&lt;?= data[i][0] ?&gt;&lt;/td&gt;
     &lt;td  class="area"&gt;&lt;?= data[i][1] ?&gt;&lt;/td&gt;
     &lt;td  class="cusname"&gt;&lt;?= data[i][2] ?&gt;&lt;/td&gt;
     &lt;td  class="cic" width = "200px"&gt;&lt;?= data[i][3] ?&gt;&lt;/td&gt;
     &lt;td  class="remarks" &gt;&lt;?= data[i][4] ?&gt;&lt;/td&gt;
     &lt;td  class="status" width = "70px"&gt;&lt;?= data[i][5] ?&gt;&lt;/td&gt;
     &lt;td  class="docdate"&gt;&lt;?= data[i][6] ?&gt;&lt;/td&gt;
     &lt;td  &gt;&lt;img class="click-to-select" src="https://docs.google.com/uc?id=0By6kUPbaVMWCbUI0LTJTR2g2N3M" alt="Submit" width="13px" height="13px" title = "Edit Selected Data" data-toggle="modal" data-target="#myModal"/&gt;
     &lt;/td&gt;
     &lt;? } ?&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>tysm for future help.</p>