Assume that the buttonClick variable stores a reference to t

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\")

Solution

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\")

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 fol

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site