Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume that the buttonClick variable stores a reference to the event handler and

ID: 3924162 • Letter: A

Question

Assume that the buttonClick variable stores a reference to the event handler and the button variable stores a reference to the button node. Which one of the following parameter lists is correct for the jsLib.event.add method? please explain the answer ?? why choosing this choice??

a.

("onclick", button, buttonClick)

c.

(button, "click", buttonClick)

b.

("click", buttonClick, button)

d.

(button, buttonClick, "onclick")

a.

("onclick", button, buttonClick)

c.

(button, "click", buttonClick)

b.

("click", buttonClick, button)

d.

(button, buttonClick, "onclick")

Explanation / Answer

Syntax is :
jsLib.event.add = function(element,type,handler)
{

}

As per the above mentioned prototype the event generated by the element(parameter 1) is handled by the appropriate handler(parameter 3) selected using the element type(parameter 2)

So the correct option is D
(button,buttonClick,"onClick")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote