29th Jun 2018, 2:10 PM
B.D
B.D - avatar
10 Antworten
+ 7
<!--Hello, Bithi D ! Your mistake was that you set the same functions on both buttons. Buttons have been replaced by different functions Please try to replace these buttons with your previous ones. Good luck! --> <button id="blink" onclick="blink()">Blink</button> <button id="stop" onclick="blinka()">Stop</button>
29th Jun 2018, 2:16 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 3
<button id="stop" onclick="blinka()">Stop</button>
29th Jun 2018, 2:56 PM
Calviղ
Calviղ - avatar
+ 3
Here the toggle blink single button control https://code.sololearn.com/W46JIRineQI5/?ref=app
29th Jun 2018, 3:16 PM
Calviղ
Calviղ - avatar
+ 2
You could use a single toggle button by setting toggle class function function toggleBlink() { var bloom = document.getElementById("bloom").classList.toggle("blink"); }
29th Jun 2018, 3:01 PM
Calviղ
Calviղ - avatar
+ 2
thank you for the suggestion
29th Jun 2018, 3:05 PM
B.D
B.D - avatar
+ 1
You have copy paste that's why you forget to write blinka function in stop.
29th Jun 2018, 2:24 PM
ᴋᵘⁿᵃˡ
ᴋᵘⁿᵃˡ - avatar
+ 1
function changeColor(color) { var x = document.getElementsByClassName("cell"); var i; for (i = 0; i < x.length; i++) { x[i].style.backgroundColor =color; } } and your color code will work with this
29th Jun 2018, 2:34 PM
ᴋᵘⁿᵃˡ
ᴋᵘⁿᵃˡ - avatar
+ 1
thank you
29th Jun 2018, 2:55 PM
B.D
B.D - avatar
+ 1
thank you
29th Jun 2018, 2:56 PM
B.D
B.D - avatar
+ 1
thank you very much
29th Jun 2018, 3:19 PM
B.D
B.D - avatar