+ 1

WHY CAN'T THIS CODE WORK

I WANT TO DISPLAY 32 IS THE RED BOX BUT WHEN I CLICK THE SECOND BUTTON, THE CURRENT IS REMOVED !! I WANT WHEN I CLICK THE BUTTON, THE NUMBERS SHOULD be DISPLAYED ON THE RED BOX AS MUCH AS I CLICK https://code.sololearn.com/W8OBLSvZQ9O2/#html

19th Apr 2019, 12:23 AM
Glory222
Glory222 - avatar
3 Answers
+ 7
Please no all caps Try using += instead of just = when setting the text content document.getElementById("wr").textContent+= second[i]; Using just = you are telling it to overwrite its contents.
19th Apr 2019, 12:28 AM
jay
jay - avatar
+ 4
Glory S Pro tip: Code as often as you can!
19th Apr 2019, 2:57 AM
jay
jay - avatar
+ 1
Thank you so much bro I really suck at JS, please can you give me some tips on improving my coding skills?
19th Apr 2019, 2:00 AM
Glory222
Glory222 - avatar