Feat(NSI): fin du chapitre sur IHM web
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
13
1NSI/08_Interaction_web/codes/projets/code-age.js
Normal file
13
1NSI/08_Interaction_web/codes/projets/code-age.js
Normal file
@@ -0,0 +1,13 @@
|
||||
//gestionnaire d'événement clic pour l'élément bouton
|
||||
function calcul_age(){
|
||||
let n = document.getElementById("naissance");
|
||||
let naissance = parseInt(n.value);
|
||||
let date = new Date();
|
||||
let courant = date.getFullYear();
|
||||
let c = document.getElementById("courant");
|
||||
c.innerHTML = courant;
|
||||
//àcompléter
|
||||
}
|
||||
|
||||
//age par défaut :
|
||||
calcul_age();
|
||||
Reference in New Issue
Block a user