title: Adding a variable content to a textarea in an HTML template
body: <p>So, I have this function that creates a dialog box in HTML. This function is also passed a message, as can be seen below:</p>
  <p>Apps Script code:</p>
  <pre><code>function emailPrompt(msg) {
    var html = HtmlService.createHtmlOutputFromFile('sendEmail')
        .setWidth(600)
        .setHeight(900);
      SpreadsheetApp.getUi()
        .showModalDialog(html, 'Send Email');
  }
  </code></pre>
  <p>sendEmail.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target=&quot;_top&quot;&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;textarea id=&quot;user-input-box&quot; rows=&quot;38&quot; cols=&quot;80&quot;&gt; [add pre-message here] &lt;/textarea&gt;
      &lt;input type=&quot;button&quot; value=&quot;Submit&quot; 
       onclick=&quot;google.script.run.MyMessage();&quot; /&gt;
      &lt;input type=&quot;button&quot; value=&quot;Cancel&quot; onclick=&quot;google.script.host.close();&quot; 
       /&gt;
      &lt;script&gt;
        function MyNote() {
          var userInput = document.getElementById(&quot;user-input-box&quot;).value;
        }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>How can I put the msg variable in the [add pre-message here] section of the textarea? I've been researching for hours online for this but really can't find anything.</p>