I am making a form on a sidebar in Google Apps Script, and I would like to autofill the "mail" input with the user's email.
I know that this variable get's the user email
var email = Session.getEffectiveUser (). getEmail ();
But I don't know how to pass the value obtained from that variable (the user's email) to the input on the form (inputmail2).
HTML form code:
<form action="">
<div>
<label for="inputmail2">Mail</label>
<input type="email" id="inputmail2">
</div>
<div>
<label for="inputproblem">Your Problem</label>
<textarea id="" ></textarea>
</div>
<div>
<button type="submit">Enviar</button>
</div>
</form>
From already thank you very much!
let inputTag = getElementsByTagName("input"); inputTag.setAttribute("value", email);You need to specify.