Chapter 18. Controls: getting user input

This chapter covers

  • Using buttons to initiate actions
  • Collecting user input with text boxes and drop-down lists
  • Calling functions automatically when a button is clicked

We love buttons! Whether we’re buying books on Amazon, liking a tweet, or sending that late-night drunken email, we find it hard to resist clicking those alluring, colorful buttons. Well, it’s time for you to issue your own calls to action and start adding buttons to your pages. And while you’re at it, you need to make space for text boxes and drop-down lists too.

In chapter 17 you made the jump to HTML and used JavaScript to add content to a web page. To get user input, however, you stuck with the console. In these days of flashy ...

Get Get Programming with JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.