Multiple choice technology web technology

Which of the following is true?

  1. If onKeyDown returns false, the key-press event is cancelled.

  2. If onKeyPress returns false, the key-down event is cancelled.

  3. If onKeyDown returns false, the key-up event is cancelled.

  4. If onKeyPress returns false, the key-up event is cancelled.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In DOM event handling, onKeyDown returning false prevents the key-press event from firing. The event sequence is keydown → keypress → keyup, and canceling keydown stops the chain. Options C and D are wrong because onKeyDown doesn't affect key-up, which always fires when the key is released.