this my sample project in app script.i am beginer in making projects in webapp. in this project, I could run a button click event and I could not enter data in input control by clicking the button. I will be thankful if anyone helps me.
code.js:
function doGet() {
return HtmlService.createHtmlOutputFromFile('index');
}
function typesomething(x) {
Logger.log(x+' to call!');
}
function dosomething() {
Logger.log('succefullly executed');
}
index.html:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
google.script.run.doSomething();
var txtname=document.getelementById("txt1");
function getdata() {
google.script.run.typesomething("MURTY LIKES TO ");
document.getelementById("txt1").value="hello world";
}
</script>
</head>
<body>
<input type="button" value="ACCEPT" onClick="getdata()"/>
<input type="text" placeholder="Enter Name." id="txt1"/>
</body>
</html>