back to the lesson

A simple page

importance: 4

Create a web-page that asks for a name and outputs it.

Run the demo

JavaScript-code:

let name = prompt("What is your name?", "");
alert(name);

The full page:

<!DOCTYPE html>
<html>
<body>

  <script>
    'use strict';

    let name = prompt("What is your name?", "");
    alert(name);
  </script>

</body>
</html>