...

/

React to the User

React to the User

Use prompt() to get input and respond with logic.

Let’s make JavaScript feel like a real conversation. In this lesson, you’ll ask the user something using prompt(), and use what they say to update your page or show a message.

Goal

You will learn to:

  • Get user input with prompt().

  • Display the input in an alert or on the page.

  • Personalize your page using what the user said. ...