Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| web:jquery:css [2026/04/01 15:50] – mno | web:jquery:css [2026/04/01 17:40] (Version actuelle) – [1. Présentation] mno | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| ===== JavaScript et jQuery - Sélection et décoration des éléments du DOM ===== | ===== JavaScript et jQuery - Sélection et décoration des éléments du DOM ===== | ||
| - | [Mise à jour le 30/3/2026] | + | [Mise à jour le 1/4/2026] |
| \\ | \\ | ||
| Ligne 12: | Ligne 12: | ||
| \\ | \\ | ||
| - | <callout icon=" | + | <callout icon=" |
| ==== 1. Présentation ==== | ==== 1. Présentation ==== | ||
| Ligne 20: | Ligne 20: | ||
| === 1.1 La fonction $() === | === 1.1 La fonction $() === | ||
| - | <callout type="primary" icon=" | + | <callout type="info" icon=" |
| // | // | ||
| Ligne 31: | Ligne 31: | ||
| === 1.2 La méthode .html de la bibliothèque jQuery === | === 1.2 La méthode .html de la bibliothèque jQuery === | ||
| - | <callout type="primary" icon=" | + | <callout type="info" icon=" |
| + | {{ : | ||
| * //Exemple - Affichage d'un texte (à tester dans **ex1.html**)// | * //Exemple - Affichage d'un texte (à tester dans **ex1.html**)// | ||
| <code html5 ex1.html> | <code html5 ex1.html> | ||
| Ligne 39: | Ligne 39: | ||
| <code javascript *.js> | <code javascript *.js> | ||
| - | // A intégrer | + | // A placer |
| let data = 12; // création d'une variable data | let data = 12; // création d'une variable data | ||
| - | | + | $("# |
| </ | </ | ||
| Ligne 47: | Ligne 47: | ||
| === 1.3 La méthode .css de la bibliothèque jQuery === | === 1.3 La méthode .css de la bibliothèque jQuery === | ||
| - | <callout type="primary" icon=" | + | <callout type="info" icon=" |
| - | + | {{ : | |
| - | * //Exemple 1 : compléter ex1.html// : changer la couleur d'un texte | + | * //Exemple 1 - Changer la couleur d'un texte (compléter ex1.html)// : |
| <code html5 *.html> | <code html5 *.html> | ||
| <!-- Fichier ex1.html --> | <!-- Fichier ex1.html --> | ||
| Ligne 56: | Ligne 56: | ||
| <code javascript *.js> | <code javascript *.js> | ||
| - | // Compléter ex1.html | ||
| let data = 12; | let data = 12; | ||
| - | | + | $("# |
| + | // A placer dans ex1.html | ||
| $("# | $("# | ||
| </ | </ | ||
| - | * //Exemple 2 à tester dans ex2.html// : changer la couleur d'un bloc | + | * //Exemple 2 - Changer la couleur d'un bloc (à tester dans ex2.html)// : |
| + | {{ : | ||
| <code html5 ex2.html> | <code html5 ex2.html> | ||
| <!-- Fichier ex2.html --> | <!-- Fichier ex2.html --> | ||
| Ligne 84: | Ligne 85: | ||
| | | ||
| $('# | $('# | ||
| - | }); // La couleur du bloc cel_a passe de grey à jaune | + | }); // La couleur du bloc cel_a passe de gris à jaune |
| </ | </ | ||
| Ligne 90: | Ligne 91: | ||
| === 1.4 La méthode .addClass de la bibliothèque jQuery === | === 1.4 La méthode .addClass de la bibliothèque jQuery === | ||
| - | <callout type="primary" icon=" | + | <callout type="info" icon=" |
| - | * //Exemple à tester dans ex3.html// : afficher un bloc de couleur | + | * // |
| + | {{ : | ||
| <code html5 *.html> | <code html5 *.html> | ||
| <!-- Fichier ex3.html --> | <!-- Fichier ex3.html --> | ||
| Ligne 117: | Ligne 119: | ||
| \\ | \\ | ||
| - | ==== 2. Application : changer la couleur d'un bloc | + | ==== 2. Applications |
| === 2.1 Changer la couleur d'un bloc en fonction d'un entier N === | === 2.1 Changer la couleur d'un bloc en fonction d'un entier N === | ||
| Ligne 142: | Ligne 144: | ||
| fin | fin | ||
| </ | </ | ||
| + | |||
| + | <callout type=" | ||
| \\ | \\ | ||
| Ligne 171: | Ligne 175: | ||
| </ | </ | ||
| + | <callout type=" | ||