Web App Development with Google Apps Script/Responding to users

JavaScript for user interfacing
This book is all about leveraging your google account to make data-driven web applications. It will not cover how to create your user interfaces very much. In this section I'll just give some simple examples, some of which don't even follow best practices but are quick and dirty approaches you can try for some proof-of-principle approaches.

User clicked something
Nearly any element in html can have an  function added to it. This includes: is not usually considered the proper way to do things, but if you're sure it's the only thing you want that element to do when the user is interacting it can work for you.
 * buttons
 * text (most easily done with  tags)
 * List items

Here's some simple html/javascript code that would open an alert saying "you clicked me" when the user presses a button:

Update some text on the page
Alerts are annoying, don't use them. Instead have the user's actions change something on the page. Here's an update to the last example where now pressing the button puts some text on the page just below the button: If you plan to make lots of changes to the text inside that, you might instead want to make a global variable like this: