Services Work Learn About Contact
0/10
Lesson 5 of 10

Event Handling

React handles events similarly to vanilla JavaScript, but with camelCase names and functions instead of strings. Common events: onClick, onChange, onSubmit, onMouseEnter.

REACT
function Form() {
  function handleClick() {
    alert("Button clicked!");
  }

  function handleChange(event) {
    console.log(event.target.value);
  }

  return (
    <div>
      <button onClick={handleClick}>Click me</button>
      <input type="text" onChange={handleChange} />
    </div>
  );
}
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed React!

You finished all 10 lessons and quizzes. You now know the basics of React.