+ 1

I can't figure out the problem on this code

In this code, there are 210 inputs and 210 td (inside table). There first 10 inputs are for something different (for names). And the 200 are for score keeping. Now find the very bottom right Input, and type a number In It > press " update". You'l find the number u entered _ In the "score" row << Scroll all the way to the right on the "score". So the number adds up and prints In the score row. Issue: When you click "Done" first, then press update, there is undefine object error. Why / how to fix that? https://code.sololearn.com/WShYa2MbsX7l/?ref=app

24th Jul 2019, 4:00 AM
Ginfio
Ginfio - avatar
1 Respuesta
+ 1
Your issue is this. Your score variable stores all input elements. With each time the 'Done' button is pressed, one of your input boxes is removed (and replaced with the name that is input) and thus is removed from your score nodelist. So the length of score is reduced too. That means that score[209] no longer exists after one press of 'Done' button. My advice: do something like this https://code.sololearn.com/WosbRIjDcwIe/?ref=app
17th Sep 2019, 4:25 PM
Russ
Russ - avatar