1. DOM Level 3 Events standardizes which of the following events?
a) focusarea and focusover
b) focusall and focusnone
c) focusdown and focusup
d) focusin and focusout
Explanation: The DOM Level 3 Events specification standardizes the focusin and focusout events as bubbling alternatives to the focus and blur events.
2. Which of the following are the unnecessary events currently?
d) All of the mentioned
Explanation: Browsers are still allowed to generate events like DOMActivate, DOMFocusIn, and DOMNodeInserted, but these are no longer required.
3. Which object is passed as the argument to handlers for keydown, keyup, and keypress events?
b) Key Event
c) Mouse Event
d) Alphabet Event
Explanation: What is new in the DOM Level 3 Events specification is standardized support for twodimensional mouse wheels via the wheel event and better support for text input events with a textinput event and with a new KeyboardEvent object that is passed as the argument to handlers for keydown, keyup, and keypress events.
4. Which property reports rotation around three different mouse wheel axes?
Explanation: A handler for a wheel event receives an event object with all the usual mouse event properties, and also deltaX, deltaY, and deltaZ properties that report rotation around three different mouse wheel axes.
5. Which of the following property specifies the string of text that was entered?
Explanation: A textinput event handler has a data property that specifies the string of text that was entered.
6. Which of the following is defined by the specification?
Explanation: The specification defines an inputMethod property on the event object and a set of constants representing different kinds of text input (keyboard, paste or drop, handwriting or voice recognition, and so on).
7. Which two events will have the generated text for key events?
a) key and char
b) char and text
c) text and key
d) key and value
Explanation: For key events that generate printable characters, key and char will be equal to the generated text.
8. Which of the following are the drag and drop events?
c) both drop and dragstart
d) none of the mentioned
Explanation: The API defines the following seven event types :
9. Which property holds a DataTransfer object that contains information about the data being transferred and the formats in whichh it is available?
Explanation: The property, dataTransfer, holds a DataTransfer object that contains information about the data being transferred and the formats in which it is available.
10. Which API allows scripts in a document from one server to exchange messages with scripts?
a) Cross-Document Messaging API
b) Web application API
c) Both Cross-Document Messaging API & Web application API
d) None of the mentioned
Explanation: The Cross-Document Messaging API allows scripts in a document from one server to exchange messages with scripts in a document from another server. This works around the limitations of the same-origin policy in a secure way. Each message that is sent triggers a message event on the Window of the receiving document.