Я хотел бы получить доступ к элементу ввода внутри формы и div.Я новичок в скрипте приложения Google и считаю, что мне нужно передать аргумент, содержащий адрес DOM, из функции JS в функцию скрипта приложения.
Вот код:
Javascript:
<script>
function update()
{
google.script.run.selectCell(document.getElementById(location));
alert("Success");//test message
}
</script>
HTML код:
<div class="container">
<form>
<div class="row">
<div class="col-25">
<label for="location">Location</label>
</div>
<div class="col-75">
<input type="text" id="location" name="location_txt" placeholder="The location..">
</div>
</div>
<div class="row">
<input type="button" onclick="update()" value="Update">
</div>
Сценарий Google App:
function selectCell(domAddress)
{
var val0 = domAddress.value;
if (cell)
{
sheet.appendRow([val0]);
}
}