To accept user input, first set up a field where users can provide input (there are many options including dialog boxes, forms, and other fields).
In `index.html`:
```HTML title="index.html"
<body>
<h1>
<?= title; ?>
</h1>
<ul>
<?!= list ?>
</ul>
<label>Add item:</label><input type='text' id='newItem'>
<button id = 'run'>
Run
</button>
<script>
function logData(){
var input = document.getElementById('newItem').value;
google.script.run.userClicked(input);
alert(input);
document.getElementById('newItem').value = ''; // clear contents
}
document.getElementById('run').addEventListener("click", logData)
</script>
</body>
```
In `Code.gs`:
```JavaScript title="Code.gs"
function userClicked(input){
console.log(input + " is the Input");
}
```
The above will simply log the input to the Execution Log (note this was not working at the time of writing).