Microsoft Introduction to Programming Using JavaScript - 98-382 Exam Practice Test
Question 1
HOTSPOT
You are designing a web page that contains a blue button. When the button is pressed, it should call a function that displays the message 'Welcome!'. When the cursor hovers over the button, the button should turn red. When the cursor leaves the button, the button should revert back to its original color of blue.
You want to complete the markup using the appropriate HTML events.
How should you complete the markup? To answer, select the appropriate event in the answer area.
NOTE: Each correct selection is worth one point.

You are designing a web page that contains a blue button. When the button is pressed, it should call a function that displays the message 'Welcome!'. When the cursor hovers over the button, the button should turn red. When the cursor leaves the button, the button should revert back to its original color of blue.
You want to complete the markup using the appropriate HTML events.
How should you complete the markup? To answer, select the appropriate event in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation:

References: https://www.w3schools.com/jsref/dom_obj_event.asp
Question 2
DRAG DROP
You are creating a web page with a script. The script will insert the window's location inside the page's input element.
How should you complete the code? To answer, drag the appropriate code segment to the correct locations. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.

You are creating a web page with a script. The script will insert the window's location inside the page's input element.
How should you complete the code? To answer, drag the appropriate code segment to the correct locations. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.

Correct Answer:

Explanation:

Box 1: document
Box 2: getElementById
Box 3: window
Box 4: location
References: https://www.w3schools.com/js/js_window_location.asp
Question 3
HOTSPOT
You are planning to use the Math object in a JavaScript application. You write the following code to evaluate various Math functions:

What are the final values for the three variables? To answer, select the appropriate values in the answer area.
NOTE: Each correct selection is worth one point.

You are planning to use the Math object in a JavaScript application. You write the following code to evaluate various Math functions:

What are the final values for the three variables? To answer, select the appropriate values in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation:

References: https://www.w3schools.com/js/js_math.asp
Question 4
HOTSPOT
You are writing a JavaScript program for Blue Yonder Airlines. The program stores various information about the airline's flights.
The program has initialized the following variables:

You need to determine the data type of the code segment based on initialization and the assignment of the variables. Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
NOTE: Each correct selection is worth one point.

You are writing a JavaScript program for Blue Yonder Airlines. The program stores various information about the airline's flights.
The program has initialized the following variables:

You need to determine the data type of the code segment based on initialization and the assignment of the variables. Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation:

References: https://www.w3schools.com/js/js_datatypes.asp

