Microsoft Introduction to Programming Using JavaScript - 98-382 Exam Practice Test

HOTSPOT
You need to evaluate the following code segment. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
Correct Answer:
You are creating a JavaScript program for an accounting system.
You create the following code. Line numbers are included for reference only.

You evaluate the code to ensure that it follows JavaScript best practices.
Which line should you change?
Correct Answer: E
HOTSPOT
You analyze the following code fragment. Line numbers are included for reference only.

Correct Answer:
HOTSPOT
You are designing a web page that contains a list of animals. The web page includes a script that outputs animals from a list.
You create the following HTML to test the script:

You need to create a function that will display the list of animals, including any formatting, in the div element.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:

Box 1: getElementsByTagName("ul")
Box 2: getElementsByTagName("li")
Box 3: innerHTML
Box 4: innerText
References: https://www.w3schools.com/jsref/met_element_getelementsbytagname.asp
0
0
0
0