Skip to content

burgoskeyberlin/int-u3l3-23-24-student-exercises

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lesson 3.3 - Events

Event Handlers

  • Event handlers are JavaScript functions that respond to events, making web pages interactive.
  • It’s similar to a doorbell ringing when someone's at the door.

Common Events:

  • Click Events: Clicking a button with the mouse.
  • Key Press Events: Typing on a keyboard.
  • Mouse Over Events: Hovering over an element.
  • Form Submission Events: Submitting a form.

.addEventListener Method

  • .addEventListener is the preferred way for adding event listeners in JS. It keeps JS separate from HTML for cleaner code.
  • Allows you to add multiple listeners to a single event.

Example:

element.addEventListener('click', function() { 
    alert('Hello, World!');
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 37.6%
  • JavaScript 34.9%
  • HTML 27.5%