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")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.