AP Principles Logo

PX_fiveJavascript_lastname

Instructions

Complete the following assignment.

Drill down to your class under your google drive.
Create a text file using notepad.
Click on this to see how notepad can used to create your html document.
File name is PX_fiveJavascript_lastname.html

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>High School Student Info</title>
</head>

<body>
  <h1>High School Student Information</h1>
  <p id="output"></p>

  <script>
    // Prompt the user for five pieces of information
    let studentName = prompt("What is your name?");
    let gradeLevel = prompt("What grade are you in?");
    let favoriteSubject = prompt("What is your favorite subject?");
    let favoriteActivity = prompt("What is your favorite school activity or club?");
    let futureGoal = prompt("What do you want to do after high school?");

    // Create a message displaying all information
    let message = "<strong>Student Profile:</strong><br><br>" +
                  "Name: " + studentName + "<br>" +
                  "Grade Level: " + gradeLevel + "<br>" +
                  "Favorite Subject: " + favoriteSubject + "<br>" +
                  "Favorite Activity/Club: " + favoriteActivity + "<br>" +
                  "Future Goal: " + futureGoal;

    // Display the message on the web page
    document.getElementById("output").innerHTML = message;
  </script>
</body>
</html>
The name of the file will be: PX_fiveJavascript_lastname

Files to save in your google drive under your class name
and to Submit to (Google Classroom)