70-480 question 69 discussion

answered

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: canvas, click = clickReporter;
Created 8 months, 3 weeks ago by luishpp

luishpp

The A answer is incorrect! C is the correct answer. (https:/https://www.exam-labs.com/jsfiddle.net/BlitzSR/tnshaa9c/1/)

radiopane

true C is the correct answer

rasik

True. A is wrong choice. HTML tags don't define any event attribute named "Clicked".

DouglasKarpinski

not exist onClick in javascript, just html

abdulslam.alnaamani@gmail.com

yes answer is c

hypuerta

yes, correct answer is c option

wutwutwut

How are these answers picked?? A is not correct.

Ramalebo

C