467). 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
Show Answer
Correct Answer: focusin and focusout
Notes:
Answer: d
Explanation: The DOM Level 3 Events specification standardizes the focusin and focusout events as bubbling alternatives to the focus and blur events. The focusin and focusout events bubble, the focus and blur events doesn’t. That means that you can use the focusin and focusout on the parent element of a form field.
468). Which of the following are the necessary events currently?
[A]DOMActivate
[B]DOMFocusIn
[C]DOMNodeInserted
[D]Onclick
Show Answer
Correct Answer: Onclick
Notes:
Answer: d
Explanation: Browsers are still allowed to generate events like DOMActivate, DOMFocusIn, and DOMNodeInserted, but these are no longer required. For example DOM activate occurs when any element becomes activate.
469). Which object is passed as the argument to handlers for keydown, keyup, and keypress events?
[A]KeyboardEvent
[B]Key Event
[C]Mouse Event
[D]Alphabet Event
Show Answer
Correct Answer: KeyboardEvent
Notes:
Answer: a
Explanation: What is new in the DOM Level 3 Events specification is standardized support for two dimensional mouse wheels via the wheel event and better support for text input events with a new KeyboardEvent object that is passed as the argument to handlers for keydown, keyup, and keypress events.
470). Which among these is a property that reports rotation of mouse wheel axes?
[A]ctrlKey
[B]alterX
[C]alterY
[D]deltaX
Show Answer
Correct Answer: deltaX
Notes:
Answer: d
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.
471). Which of the following property specifies the string of text that was entered?
[A]message
[B]data
[C]string
[D]text
Show Answer
Correct Answer: data
Notes:
Answer: b
Explanation: A textinput event handler has a data property that specifies the string of text that was entered. This data property is used for manipulating the data which is entered by the user.
472). Which of the following is defined by the specification?
[A]dataMethod
[B]input
[C]inputMethod
[D]inputdataMethod
Show Answer
Correct Answer: inputMethod
Notes:
Answer: c
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). prompt function is a kind of input method.
473). 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
Show Answer
Correct Answer: key and char
Notes:
Answer: a
Explanation: For key events that generate printable characters, key and char will be equal to the generated text. Both key and char are onkeypress event which occurs when the user presses a key (on the keyboard).
474). Which of the following are the drag and drop events?
[A]drop
[B]dragstart
[C]both drop and dragstart
[D]dropover
Show Answer
Correct Answer: both drop and dragstart
Notes:
Answer: c
Explanation: HTML Drag and Drop interfaces enable applications to use drag and drop features in Firefox and other browsers. The API defines the following seven event types :
dragstart
drag
dragend
dragenter
dragover
dragleave
drop
475). Which property holds a DataTransfer object that contains information about the data being transferred and the formats in which it is available?
[A]dataTransfer
[B]transferData
[C]dataExchange
[D]exchangeData
Show Answer
Correct Answer: dataTransfer
Notes:
Answer: a
Explanation: The property, dataTransfer, holds a DataTransfer object that contains information about the data being transferred and the formats in which it is available. The DataTransfer object is used to hold the data that is being dragged during a drag and drop operation.
476). 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]Cross-linking API
Show Answer
Correct Answer: Cross-Document Messaging API
Notes:
Answer: a
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.