React DOM events quiz

React DOM events quiz

Last Updated :
Discuss
Comments

Question 1

How does React handle DOM events compared to plain HTML?

  • React uses lowercase event names and string handlers

  • React uses camelCase event names and functions

  • React binds events using jQuery

  • React does not support DOM events

Question 2

What is passed automatically to every React event handler?

  • DOM node

  • HTML element

  • Event object

  • State value

Question 3

How does onClickCapture differ from onClick in React?

  • It only works with buttons

  • It triggers during the bubbling phase

  • It fires during the capture phase

  • It prevents default behavior

Question 4

When does the onMouseDown event fire in React?

  • When a mouse button is released

  • When a mouse button is held down

  • When the mouse enters the element

  • When a mouse button is clicked

Question 5

What triggers the onDoubleClick event in React?

  • Two fast mouseovers

  • A mouse press and release

  • Scrolling and clicking together

  • Two consecutive clicks in a short time

Question 6

What must you do in a React form's onSubmit handler to prevent page reload?

  • Call form.stop()

  • Return false

  • Use event.preventDefault()

  • Set autoSubmit to false

Question 7

Where is onSubmit usually used in React?

  • On <form> elements

  • On <div> elements

  • On <button> elements

  • On <input> elements

Question 8

Which element must be scrollable for onScroll to fire in React?

  • <form>

  • The element with onScroll attached

  • The entire document

  • <input> only

Question 9

What does the onBlur event in React detect?

  • Input field gains focus

  • Element is hovered

  • Page is reloaded

  • Element loses focus

Question 10

What is a "SyntheticEvent" in React?

  • A custom event created manually

  • A wrapper around browser events for consistency

  • A third-party event library

  • An error caused during bubbling

There are 10 questions to complete.

Take a part in the ongoing discussion