Javascript (15) - Objet event

5 Feb 2019 · 11 min
11:21

In this French‑language tutorial, the presenter walks through the JavaScript Event object, explaining how it is automatically created when an event fires and how it provides a wealth of information useful for interactive web programming. The lesson starts with a simple click handler on a div (identified as "orange") and shows how to log the event’s type. It then contrasts the target property (the deepest element under the cursor at the moment of the event) with currentTarget (the element on which the listener was attached), demonstrating the difference by clicking on nested divs. The speaker proceeds to explore mouse‑button detection via the button property, keyboard detection via keyCode (including ASCII codes for letters and the Enter key), and mouse‑position tracking using clientX and clientY, adjusting coordinates relative to the element with offsetLeft/offsetTop. Modifier‑key flags shiftKey, altKey, and ctrlKey are also shown. Finally, the tutorial covers event flow control: the bubbling phase versus capture, how stopPropagation can halt propagation, and how preventDefault cancels a browser’s default action (e.g., form submission). Throughout, live code snippets are executed and console output is displayed, reinforcing each concept. The video ends with a brief recap and invitation to the next lesson.

Chapters

More from Yamossoun

8:56
youtube.com

Compteur synchrone - Logique séquentielle

2w ago
11:58
youtube.com

Compteur asynchrone et diviseur de fréquence - Logique séquentielle

3w ago
11:37
youtube.com

Les registres (parallèle et à décalage) - Logique séquentielle

1mo ago
6:14
youtube.com

Bascule T (Toggle) - Logique séquentielle

1mo ago
12:05
youtube.com

Bascule JK - Logique séquentielle

1mo ago
9:17
youtube.com

Bascule D flip-flop active sur front montant - Logique séquentielle

1mo ago
10:08
youtube.com

Bascule D Latch - Logique séquentielle

1mo ago
8:13
youtube.com

Bascule RS - Logique séquentielle

1mo ago
5:04
youtube.com

Logique séquentielle - Introduction

2mo ago
1:15
youtube.com

Le codeur - Logique combinatoire #codeur #logique #circuit #booleanlogic

2mo ago
1:56
youtube.com

Algorithme de calcule de la racine carrée par dichotomie #dichotomy #squareroot #algorithm

3mo ago
See all content