exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 40 discussion

Actual exam question from Microsoft's 70-480
Question #: 40
Topic #: 2
[All 70-480 Questions]

You troubleshoot a webpage that contains the following HTML element:
<canvas id= "clickCanvas" width="300"> height= "300">Your browser does not support the HTML5 canvas.</canvas>
The following JavaScript code is included in a script tag in the HEAD section of the webpage: (Line numbers are included for reference only.)

You need to invoke the clickReporter() JavaScript function when a user clicks the mouse on the canvas HTML element.
What should you do?

  • A. Add the following attribute to the canvas HTML element: clicked= "clickReporter()"
  • B. Replace the code segment at line 06 with the following code segment: drawBox.Click += clickReporter;
  • C. Insert the following code segment at line 07: canvas.onclick = clickReporter;
  • D. Insert the following code segment at line 07:
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Arcarnan
Highly Voted 5 years, 7 months ago
A is incorrect, as clicked is not valid syntax. The correct answer here should be C.
upvoted 14 times
JoelChuca
4 years, 8 months ago
Yes, C is the correct. https://codepen.io/chobe/pen/QWNojKm
upvoted 3 times
...
AOD01
4 years, 4 months ago
Im test the code with response A and it's ok
upvoted 1 times
...
...
nootje
Most Recent 3 years, 8 months ago
The only correct answer is C. For A to work you need onclick instead of clicked
upvoted 1 times
...
RJGV
4 years, 9 months ago
C is correct when I typed it all into repl.it
upvoted 2 times
...
stef1
5 years, 2 months ago
A would be correct if it was: onclick= "clickReporter()" . C is correct and working perfectly.
upvoted 2 times
...
PhiDang
5 years, 3 months ago
The correct answer is C.
upvoted 4 times
...
Lonan
5 years, 6 months ago
Isn't it D?
upvoted 1 times
...
Etnic
5 years, 6 months ago
both A and C worked for me.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...