0

Helper function remain off

If Next button is click and Helper button was click off, remain off function nextFunc() { if(i < Object.keys(countSet).length) numcount.innerHTML = Object.keys(countSet)[+i]; helper.className = Object.keys(countSet)[i]; } nextFunc(); helper.onclick = function() { if(helper.className == "open") /* If helper html is clicked */ { helper.className = ""; numcount.innerHTML = Object.keys(countSet)[+i]; } else { helper.className = "open"; numcount.innerHTML = "Helper Off"; } }; https://code.sololearn.com/W11b9QE6fpZr/?ref=app

6th Feb 2022, 6:41 PM
Steve Nova
Steve Nova - avatar
2 ответов
+ 1
Hello Steve Nawa , you have to make 3 changes to your code. 1) add a variable helper_switch 2) make changes in IF condition of nextFunc() 3) make changes in helperFunc() I have attached code with changes you can find comments near the change I have made. https://code.sololearn.com/WWH89fFTzJFn/?ref=app
7th Feb 2022, 9:53 AM
Meetesh
Meetesh - avatar
0
Oh my God this is amazing. Meetesh thank you so much, I don't know how you did it, but thank you big time😄👍
7th Feb 2022, 1:17 PM
Steve Nova
Steve Nova - avatar