PrepAway - Latest Free Exam Questions & Answers

You are troubleshooting a web page that includes the following code.

You are troubleshooting a web page that includes the following code. (Line numbers are included for reference only.)



What is displayed in the alert from line 11?

A. Div

B. Function

C. Button

D. Document

Explanation:

* The event handler here normalizes event object (passed as a first argument) and invokes handleCellClick in a proper context (i.e. referring to an element that was attached event listener to). The element is the button elButton.

* addEventListener

Syntax: element.addEventListener(event, function, useCapture)

Reference: HTML DOM addEventListener() Method


Leave a Reply