Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 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 code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

What is the long-term outcome for people with psychotic disorders?

Answered: 1 week ago

Question

What are topics included within employee services?

Answered: 1 week ago

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago