Q. Which of the following are not key event properties?

  • (A) Code key
  • (B) Alt Key
  • (C) Ctrl Key
  • (D) Shift Key
πŸ’¬ Discuss
βœ… Correct Answer: (A) Code key
Explanation: altKey, ctrlKeY, shiftKey, and metaKey are key event object’s properties, which are set to true if the corresponding modifier key is held down when the event occurs.

Q. Which of the following key property holds the key name as a string?

  • (A) keyName
  • (B) key
  • (C) keyName(string)
  • (D) Nameofkey(string)
πŸ’¬ Discuss
βœ… Correct Answer: (B) key
Explanation: The DOM Level 3 Events defines a new key property that contains the key name as a string.

Q. Which of the following is not the value the key property will hold if the key is a function key?

  • (A) F8
  • (B) F2
  • (C) Home
  • (D) Left
πŸ’¬ Discuss
βœ… Correct Answer: (A) F8
Explanation: If the key is a function key, the key property will be a value like “F2”, “Home”, or “Left”.

Q. Which method is used to add a binding?

  • (A) binding()
  • (B) add_bind()
  • (C) bind()
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) bind()
Explanation: To add a binding, use bind() method.

Q. Which method is used to remove a binding?

  • (A) Unbind()
  • (B) removebind()
  • (C) remove(Bind b)
  • (D) unbind()
πŸ’¬ Discuss
βœ… Correct Answer: (D) unbind()
Explanation: To remove a bind, use unbind() method.

Q. Which of the following are the parameters passed to the keymap after installation?

  • (A) Key property
  • (B) Key name
  • (C) Keydown event’s object
  • (D) Key stroke
πŸ’¬ Discuss
βœ… Correct Answer: (C) Keydown event’s object
Explanation: After the keymap is installed, the following parameters are passed:

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (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.

Q. Which of the following are the unnecessary events currently?

  • (A) DOMActivate
  • (B) DOMFocusIn
  • (C) DOMNodeInserted
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned
Explanation: Browsers are still allowed to generate events like DOMActivate, DOMFocusIn, and DOMNodeInserted, but these are no longer required.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (A) KeyboardEvent
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.

Q. Which property reports rotation around three different mouse wheel axes?

  • (A) ctrlKey
  • (B) alterX
  • (C) alterY
  • (D) deltaX
πŸ’¬ Discuss
βœ… Correct Answer: (D) deltaX
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.