A Guide to Handling Browser Events

Publikováno: 13.3.2020

In this post, Sarah Chima walks us through how we can work with browser events, such as clicking, using JavaScript. There’s a ton of great info in here! If JavaScript isn’t your strong suit, I think this is the best explanation of event handling that I’ve read in quite some time.

When an event occurs, the browser creates an event object and passes it as an argument to the event handler. This event object contains details of the event. For

Read article “A Guide to Handling Browser Events”

The post A Guide to Handling Browser Events appeared first on CSS-Tricks.

Celý článek

In this post, Sarah Chima walks us through how we can work with browser events, such as clicking, using JavaScript. There’s a ton of great info in here! If JavaScript isn’t your strong suit, I think this is the best explanation of event handling that I’ve read in quite some time.

When an event occurs, the browser creates an event object and passes it as an argument to the event handler. This event object contains details of the event. For instance, you might want to know which button was clicked or which key was pressed or the mouse coordinates when the event occurred. You can get all of these from the event object.

Sarah also links to this really good primer on bubbling and capturing that’s worth checking out, too.

Direct Link to ArticlePermalink

The post A Guide to Handling Browser Events appeared first on CSS-Tricks.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace