Sonzaschool
Back

O-Level · Form 2 · Vocational · Electronics and Computer

Computer Programming

Implementing event handling

about 3 minutes to read

Discussions
Topics in this sectionImplementing web scripting4 topics

Event Handling in Web Pages

When you browse a website, you often click buttons, move your mouse over images, or fill in forms. Each of these actions triggers an event — a signal that tells the web page something has happened. Event handling is the process of writing code that responds to these events, making web pages interactive and dynamic.


An event is an action or occurrence that happens in the browser, usually started by the user. The browser listens for these events and can run specific code when they occur.

Common Events You Will Use

  • onclick — triggered when an element is clicked
  • onmouseover — triggered when the mouse moves over an element
  • onmouseout — triggered when the mouse moves away from an element
  • onload — triggered when a page or image finishes loading
  • onsubmit — triggered when a form is submitted

How you'll be assessedProcess assessment · Outcome assessment · Knowledge assessment

Process assessment

  • Attach event handlers to HTML elements.
  • Use inline and external event handling methods.
  • Test event-driven scripts for interactivity.

Outcome assessment

Web pages responding correctly to user actions are implemented according to requirements.

Knowledge assessment

Detailed knowledge of:

Method used: The student should explain how to:

  • handle events in JavaScript.

Principles: The student should explain the principle of:

  • event propagation model (bubbling and capturing).

Theories: The student should explain:

  • Inline vs. external event handling.

Circumstantial knowledge:

Detailed knowledge about:

  • common events in web programming

Question

What is an event in web programming?

Sign in to submit your answer and have it count toward your mastery.

Sign in to practice

Tutor

Stuck? Ask me anything about this topic.

Sign in to ask the Sonza AI Tutor about this question.

Sign in to ask

Discussions

No questions yet

Sign in to ask
Loading discussions…