Problème pour JAVASCRIPTEURS
Fermé
JessayeDeTrouver
Messages postés
270
Date d'inscription
mercredi 9 septembre 2009
Statut
Membre
Dernière intervention
4 mai 2012
-
14 nov. 2009 à 16:48
avion-f16 Messages postés 19246 Date d'inscription dimanche 17 février 2008 Statut Contributeur Dernière intervention 21 avril 2024 - 14 nov. 2009 à 17:27
avion-f16 Messages postés 19246 Date d'inscription dimanche 17 février 2008 Statut Contributeur Dernière intervention 21 avril 2024 - 14 nov. 2009 à 17:27
1 réponse
avion-f16
Messages postés
19246
Date d'inscription
dimanche 17 février 2008
Statut
Contributeur
Dernière intervention
21 avril 2024
4 499
14 nov. 2009 à 17:27
14 nov. 2009 à 17:27
Dans ton contenu :
<div id='ligne1'>2</div> <div id='ligne2'>5</div> <div id='ligne3'>2</div>Dans l'entête (entre <head> et </head>) :
<script type="javascript"> function incrementer() { // Création des raccourcis var ligne1 = document.getElementById('ligne1'); var ligne2 = document.getElementById('ligne2'); var ligne3 = document.getElementById('ligne3'); // Incrémentation de la ligne 1 var valeurLigne1 = ligne1.innerHTML; valeurLigne1++; ligne1.innerHTML = valeurLigne1; // Incrémentation de la ligne 2 var valeurLigne2 = ligne1.innerHTML; valeurLigne2++; ligne2.innerHTML = valeurLigne2; // Incrémentation de la ligne 3 var valeurLigne3 = ligne1.innerHTML; valeurLigne3++; ligne3.innerHTML = valeurLigne3; } window.onload = function() { setInterval("incrementer()",1000) } </script>