Microsoft Exam Questions

How should you build the code segment?

HOTSPOT
An HTML page has a canvas element.
You need to draw a red rectangle on the canvas element dynamically. The rectangle should
resemble the following graphic.

How should you build the code segment? (To answer, select the appropriate options from
the drop-down lists in the answer area.)

Answer:

Explanation: