Answered step by step
Verified Expert Solution
Question
1 Approved Answer
lab2.html Lab 2_2 Lab 2_2 with JavaScript 1. Download and extract the lab2_2.html file 2. Open the file in Chrome, right click on the page
lab2.html
Lab 2_2 with JavaScript
1. Download and extract the lab2_2.html file 2. Open the file in Chrome, right click on the page and select Inspect 3. Select the Console tab. It is OK to see file not found error message for now. 4. Type the following JavaScript code line into the console. Click enter after the line the code. let userInput = prompt('What number is your lucky number?'); You should see a new a dialog box that asks your input. You can give a number and click "OK" button. The type in the following line of code and click enter. userInput; typeof(userInput); let luckyNumber = document.getElementById('luckyNumber"); luckyNumber.innerHTML = 'Your lucky number is ' + userInput + "'; alert('Your lucky number is ' + userInput + '.'); Click "OK" button after the last line of code is excuted. Based on your observations of the output and research, answer the following questions a. [1 point] Explain what the prompt() does in the first line of code. b. [1 point] What was returned to the console when you enter userInput? c. [1 point] What is the type of the userInput? d. [1 point] What does alert() do in the last line of codeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started