HTML and CSS Reference
In-Depth Information
Which of the following isn't a supported way to add an event handler to a DOM
element?
1.
Declaring within the HTML element by assigning the event attribute to a JavaScript
function
A.
Setting the attribute in CSS to a valid JavaScript function
B.
Dynamically through JavaScript by assigning a JavaScript function to the object's
event property
C.
Dynamically through JavaScript via the assign/remove event listener methods
D.
Which of the following isn't an attribute of an anonymous function?
A.
Anonymous functions can't be called by any other code.
B.
Anonymous functions have a clearly defined name.
2.
Anonymous functions can be passed as parameters.
C.
Anonymous functions can't be assigned to a DOM element declaratively.
D.
Which code line would successfully cancel an event?
A.
window.event.returnValue = false;
B.
return false;
C.
window.event.Return();
D.
window.Stop();
3.
Which event occurs when a DOM element receives the cursor?
A.
focus
B.
change
C.
keydown
D.
mouseleave
4.
Which option provides the correct sequence of events in a drag-and-drop operation?
A.
dragstart
,
drag
,
dragenter
,
drop
B.
dragstart
,
drag
,
dragenter
,
dragstop
C.
drag
,
dragstart
,
drop
,
dragenter
D.
drag
,
dragstart
,
dragenter
,
dragstop
5.
Search WWH ::
Custom Search