I am wanting to display what the user entered after the user has finished inputting in information. When the user gets to the last prompt I want the page to display what they entered in. For example: if they entered in apples under the name portion I want it to list the word apples in the P1 section of my code at the bottom. I am new to javascript and in advance, I know my code is choppy but I am learning so please go easy on me and please help me figure out how to display user-input after the javascript has finished.
My code:
<!DOCtype html>
<html>
<head>
<title> This will display some answers </title>
<body>
<script type="text/javascript">
var user = prompt("Welcome to learning about allocations with me, mr fields.
In this tutorial we will be learning about alloction exceptions and what not
to do with them. Let's get started, shall we? ").toUpperCase();
switch(user){
case 'YES':
var user_1 = prompt("What's your name?");
switch(user_1) {
case 'Buster':
prompt("Hey, brother!");
break;
case 'Alex':
prompt("I've made a huge mistake.");
break;
case 'Steve':
prompt("Steve Holt!");
break;
default:
prompt("I don't know you!");}
break;
default:
prompt("too bad!");
}
</script>
</body>
</head>
<h1> answer </h1>
<p1> "answers should go here" </p1>
</html>