+ 1

Why function does't work?

"Undo" function doesn't work properly. https://code.sololearn.com/W1bQLVfUch1c/?ref=app

16th Nov 2021, 6:01 PM
Adilx01
1 Resposta
+ 4
I think you need to use counter-1 in the undo-function for indexing: undo.onclick= function(){ if(last[counter-1].innerHTML!="") last[counter-1].innerHTML=""; counter--; }
16th Nov 2021, 6:15 PM
Lisa
Lisa - avatar