File tree 2 files changed +10
-19
lines changed
2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 4
4
*
5
5
*********************************************************************************/
6
6
7
- lancerJeu ( )
8
-
9
- // J'ai mis ce code en commentaire, nous pourrons le récupérer lorsque nous en auront besoin :
10
-
11
- // let inputEcriture = document.getElementById("inputEcriture")
12
- // console.log(inputEcriture)
13
-
14
- // let btnValiderMot = document.getElementById("btnValiderMot")
15
- // console.log(btnValiderMot)
16
-
17
- // let zoneProposition = document.querySelector(".zoneProposition")
18
- // console.log(zoneProposition)
19
-
20
- // let spanScore = document.querySelector(".zoneScore span")
21
- // console.log(spanScore)
22
-
23
- // let listeBtnRadio = document.querySelectorAll(".optionSource input")
24
- // console.log(listeBtnRadio)
7
+ lancerJeu ( )
Original file line number Diff line number Diff line change @@ -121,8 +121,10 @@ function lancerJeu() {
121
121
let listeProposition = listeMots
122
122
123
123
let btnValiderMot = document . getElementById ( "btnValiderMot" )
124
+ let listeBtnRadio = document . querySelectorAll ( ".optionSource input" )
124
125
let inputEcriture = document . getElementById ( "inputEcriture" )
125
126
127
+
126
128
afficherProposition ( listeProposition [ i ] )
127
129
128
130
// Gestion de l'événement click sur le bouton "valider"
@@ -135,14 +137,20 @@ function lancerJeu() {
135
137
inputEcriture . value = ''
136
138
if ( listeProposition [ i ] === undefined ) {
137
139
afficherProposition ( "Le jeu est fini" )
140
+ // On désactive le bouton valider
138
141
btnValiderMot . disabled = true
142
+ // On désactive les boutons radios
143
+ for ( let indexBtnRadio = 0 ; indexBtnRadio < listeBtnRadio . length ; indexBtnRadio ++ ) {
144
+ listeBtnRadio [ indexBtnRadio ] . disabled = true
145
+ }
146
+
139
147
} else {
140
148
afficherProposition ( listeProposition [ i ] )
141
149
}
142
150
} )
143
151
144
152
// Gestion de l'événement change sur les boutons radios.
145
- let listeBtnRadio = document . querySelectorAll ( ".optionSource input" )
153
+
146
154
for ( let index = 0 ; index < listeBtnRadio . length ; index ++ ) {
147
155
listeBtnRadio [ index ] . addEventListener ( "change" , ( event ) => {
148
156
// Si c'est le premier élément qui a été modifié, alors nous voulons
You can’t perform that action at this time.
0 commit comments