SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Les Evènements
en JavaScripT
LESEVENEMENTSENJA
VASCRIPT
• Les évènements correspondent à des actions effectuées
soit parun utilisateur, soit par le navigateur lui-même.
• Par exemple, lorsqu’un utilisateur clique sur un bouton
HTML ou lorsque le navigateur va finir de charger une
page web, on va parler d’événement.
• Parfois, on va vouloir «attacher »une action spécifique à
un évènement, comme par exemple modifier la taille des
textes surune page lorsque l’utilisateur clique sur un
bouton.
LESEVENEMENTSENJA
V
ASCRIPT
Exemple
LESEVENEMENTSENJA
VASCRIPT
Le DOM HTML va nous permettre d’assigner des gestionnaires d’évènements
spécifiques à des éléments HTML en utilisant le JavaScript.
LESEVENEMENTSENJA
VASCRIPT
L’utilisation du mot clef " this " dans la gestion d’évènements
Dans le contexte de la gestion d’événements, this va faire référence à
l’objet (représentant l’élément HTML) qui est le sujet de l’événement.
LESEVENEMENTSENJA
VASCRIPT
La méthode JavaScript addEventListener()
• La méthode addEventListener() va nous permettre de lier du code à
un évènement. On parlera alorsde gestionnaire d’évènements.
• Le code sera alors exécuté dès le déclenchement de l’évènement.
• Cette méthode appartient à l’objet Element et va avoir besoin de
deux argumentspourfonctionner :
Le nom de l’évènement déclencheur de l'action et
Le code relatif à l’action à effectuer.
• Les événements vont une nouvelle fois avoir des noms similaires aux
attributs HTML mais ne vont plus être précédés du «on »(par exemple,
onclick devient click).
LESEVENEMENTSENJA
V
ASCRIPT
La méthode JavaScript addEventListener()
LESEVENEMENTSENJA
VASCRIPT
La méthode JavaScript addEventListener()
• L’un des grands avantages de la méthode addEventListener() est de
pouvoir lier plusieurs gestionnaires d’évènements de même type sur un
élément HTML.
42
LESEVENEMENTSENJA
VASCRIPT
La méthode JavaScript addEventListener()
• Elle va également nouspermettre de lier plusieurs évènements
différents à un même élément HTML.
LESEVENEMENTSENJA
VASCRIPT
p1.
Evénements de souris
En JavaScript, il existe plusieurs événements de souris que vous pouvez écouter pour interagir avec
l'utilisateur. Voici quelques-uns des événements de souris les plus couramment utilisés :
1.click : Cet événement se déclenche lorsqu'un élément est cliqué avec le bouton gauche de la souris.
2.dblclick : Cet événement se déclenche lorsqu'un élément est double-cliqué avec le bouton gauche de la
souris.
3.mousedown : Cet événement se déclenche lorsque le bouton de la souris est enfoncé sur un élément.
4.mouseup : Cet événement se déclenche lorsque le bouton de la souris est relâché sur un élément.
5.mousemove : Cet événement se déclenche lorsqu'un élément est survolé par la souris.
6.mouseover : Cet événement se déclenche lorsqu'un élément est survolé par la souris.
7.mouseout : Cet événement se déclenche lorsque la souris quitte la zone d'un élément.
8.contextmenu : Cet événement se déclenche lorsqu'un élément est cliqué avec le bouton droit de la souris
LESEVENEMENTSENJA
VASCRIPT
p1.
Evénements de souris
Exemple:
LESEVENEMENTSENJA
VASCRIPT
L’objet Event
L'objet eventen JavaScriptcontient plusieurs propriétés qui permettentd'accéder
aux informations de l'événement en cours, notammentla propriété key. La propriété
key permet de récupérer la touchequi a été pressée lors d'un événement de frappe
(keydown ou keyup).
Voici les différentes valeurs possibles pour la propriété key :
1-Lettresetchiffres
Les touches de lettres et de chiffres ont la même valeur que leur représentation en
caractère. Par exemple : a, b, c, ..., z 0, 1, 2, ..., 9
LESEVENEMENTSENJA
VASCRIPT
L’objet Event
2-Touchesspéciales
Certaines touches spéciales ont des valeurs spécifiques pour la propriété key. Voici
quelques exemples :
Enter:la touche Entrée
Backspace:la touche Retour arrière
Escape:la touche Échap
Tab:la toucheTabulation
Shift:la touche Maj
Control:la touche Ctrl
Alt:la toucheAlt
ArrowUp,ArrowDown,ArrowLeft,ArrowRight:les touches fléchées
LESEVENEMENTSENJA
VASCRIPT
L’objet Event
3-Touchesfonction
Les touches de fonction (F1 à F12) ont également des valeurs spécifiques pour la
propriété key. Par exemple : F1, F2, F3, ..., F12
4-Autrestouches
Enfin, certaines touches n'ont pas de valeur spécifique pour la propriété key et sont
représentées par leur nom en anglais. Par exemple :
CapsLock:la touche Verr Maj
PrintScreen:la touche Impr écran
Insert:la touche Inser
Delete:la toucheSuppr
LESEVENEMENTSENJA
V
ASCRIPT
L’objet Event
LESEVENEMENTSENJA
V
ASCRIPT
Exercice:
Réaliser la page ci-dessous sachant qu’on n’appuyant sur la touche Entrer de clavier le
Total sera calculé:

Contenu connexe

Dernier

gestion des conflits dans les entreprises
gestion des  conflits dans les entreprisesgestion des  conflits dans les entreprises
gestion des conflits dans les entreprisesMajdaKtiri2
 
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfCours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfachrafbrahimi1
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfabatanebureau
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...Nguyen Thanh Tu Collection
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne FontaineTxaruka
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film françaisTxaruka
 
Apolonia, Apolonia.pptx Film documentaire
Apolonia, Apolonia.pptx         Film documentaireApolonia, Apolonia.pptx         Film documentaire
Apolonia, Apolonia.pptx Film documentaireTxaruka
 
Computer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptxComputer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptxRayane619450
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.Txaruka
 
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...Faga1939
 
La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film françaisTxaruka
 
Cours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdfCours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdfssuserc72852
 

Dernier (13)

gestion des conflits dans les entreprises
gestion des  conflits dans les entreprisesgestion des  conflits dans les entreprises
gestion des conflits dans les entreprises
 
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfCours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne Fontaine
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film français
 
Apolonia, Apolonia.pptx Film documentaire
Apolonia, Apolonia.pptx         Film documentaireApolonia, Apolonia.pptx         Film documentaire
Apolonia, Apolonia.pptx Film documentaire
 
Computer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptxComputer Parts in French - Les parties de l'ordinateur.pptx
Computer Parts in French - Les parties de l'ordinateur.pptx
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.
 
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...
L'ÉVOLUTION DE L'ÉDUCATION AU BRÉSIL À TRAVERS L'HISTOIRE ET LES EXIGENCES DE...
 
Evaluación Alumnos de Ecole Victor Hugo
Evaluación Alumnos de Ecole  Victor HugoEvaluación Alumnos de Ecole  Victor Hugo
Evaluación Alumnos de Ecole Victor Hugo
 
La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film français
 
Cours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdfCours Préparation à l’ISO 27001 version 2022.pdf
Cours Préparation à l’ISO 27001 version 2022.pdf
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Les evenements.pdf

  • 2. LESEVENEMENTSENJA VASCRIPT • Les évènements correspondent à des actions effectuées soit parun utilisateur, soit par le navigateur lui-même. • Par exemple, lorsqu’un utilisateur clique sur un bouton HTML ou lorsque le navigateur va finir de charger une page web, on va parler d’événement. • Parfois, on va vouloir «attacher »une action spécifique à un évènement, comme par exemple modifier la taille des textes surune page lorsque l’utilisateur clique sur un bouton.
  • 4. LESEVENEMENTSENJA VASCRIPT Le DOM HTML va nous permettre d’assigner des gestionnaires d’évènements spécifiques à des éléments HTML en utilisant le JavaScript.
  • 5. LESEVENEMENTSENJA VASCRIPT L’utilisation du mot clef " this " dans la gestion d’évènements Dans le contexte de la gestion d’événements, this va faire référence à l’objet (représentant l’élément HTML) qui est le sujet de l’événement.
  • 6. LESEVENEMENTSENJA VASCRIPT La méthode JavaScript addEventListener() • La méthode addEventListener() va nous permettre de lier du code à un évènement. On parlera alorsde gestionnaire d’évènements. • Le code sera alors exécuté dès le déclenchement de l’évènement. • Cette méthode appartient à l’objet Element et va avoir besoin de deux argumentspourfonctionner : Le nom de l’évènement déclencheur de l'action et Le code relatif à l’action à effectuer. • Les événements vont une nouvelle fois avoir des noms similaires aux attributs HTML mais ne vont plus être précédés du «on »(par exemple, onclick devient click).
  • 8. LESEVENEMENTSENJA VASCRIPT La méthode JavaScript addEventListener() • L’un des grands avantages de la méthode addEventListener() est de pouvoir lier plusieurs gestionnaires d’évènements de même type sur un élément HTML. 42
  • 9. LESEVENEMENTSENJA VASCRIPT La méthode JavaScript addEventListener() • Elle va également nouspermettre de lier plusieurs évènements différents à un même élément HTML.
  • 10. LESEVENEMENTSENJA VASCRIPT p1. Evénements de souris En JavaScript, il existe plusieurs événements de souris que vous pouvez écouter pour interagir avec l'utilisateur. Voici quelques-uns des événements de souris les plus couramment utilisés : 1.click : Cet événement se déclenche lorsqu'un élément est cliqué avec le bouton gauche de la souris. 2.dblclick : Cet événement se déclenche lorsqu'un élément est double-cliqué avec le bouton gauche de la souris. 3.mousedown : Cet événement se déclenche lorsque le bouton de la souris est enfoncé sur un élément. 4.mouseup : Cet événement se déclenche lorsque le bouton de la souris est relâché sur un élément. 5.mousemove : Cet événement se déclenche lorsqu'un élément est survolé par la souris. 6.mouseover : Cet événement se déclenche lorsqu'un élément est survolé par la souris. 7.mouseout : Cet événement se déclenche lorsque la souris quitte la zone d'un élément. 8.contextmenu : Cet événement se déclenche lorsqu'un élément est cliqué avec le bouton droit de la souris
  • 12. LESEVENEMENTSENJA VASCRIPT L’objet Event L'objet eventen JavaScriptcontient plusieurs propriétés qui permettentd'accéder aux informations de l'événement en cours, notammentla propriété key. La propriété key permet de récupérer la touchequi a été pressée lors d'un événement de frappe (keydown ou keyup). Voici les différentes valeurs possibles pour la propriété key : 1-Lettresetchiffres Les touches de lettres et de chiffres ont la même valeur que leur représentation en caractère. Par exemple : a, b, c, ..., z 0, 1, 2, ..., 9
  • 13. LESEVENEMENTSENJA VASCRIPT L’objet Event 2-Touchesspéciales Certaines touches spéciales ont des valeurs spécifiques pour la propriété key. Voici quelques exemples : Enter:la touche Entrée Backspace:la touche Retour arrière Escape:la touche Échap Tab:la toucheTabulation Shift:la touche Maj Control:la touche Ctrl Alt:la toucheAlt ArrowUp,ArrowDown,ArrowLeft,ArrowRight:les touches fléchées
  • 14. LESEVENEMENTSENJA VASCRIPT L’objet Event 3-Touchesfonction Les touches de fonction (F1 à F12) ont également des valeurs spécifiques pour la propriété key. Par exemple : F1, F2, F3, ..., F12 4-Autrestouches Enfin, certaines touches n'ont pas de valeur spécifique pour la propriété key et sont représentées par leur nom en anglais. Par exemple : CapsLock:la touche Verr Maj PrintScreen:la touche Impr écran Insert:la touche Inser Delete:la toucheSuppr
  • 16. LESEVENEMENTSENJA V ASCRIPT Exercice: Réaliser la page ci-dessous sachant qu’on n’appuyant sur la touche Entrer de clavier le Total sera calculé: