+ 10

Getting no output.

Hay guys I had written a code in which I am storing some strings in array when a button is pressed. And after storing the values in array I had to convert it into string then display it on the screen. But my code dosen't show any output . Can anyone suggest me what's wrong here . https://code.sololearn.com/WPpRBg1eRi5x/?ref=app

7th Apr 2020, 3:28 AM
Ayush Kumar
Ayush Kumar - avatar
3 ответов
+ 3
https://code.sololearn.com/WellF79n8Bhg/?ref=app
7th Apr 2020, 4:42 AM
ODLNT
ODLNT - avatar
+ 3
var arr = []; var total; function a1(){ var b1 = "1"; arr.push(b1); total=arr.toString(); document.getElementById("all").innerHTML=total; } function a2(){ var b1 = "2"; arr.push(b1); total=arr.toString(); document.getElementById("all").innerHTML=total; } function a3(){ var b1 = "3"; arr.push(b1); total=arr.toString(); document.getElementById("all").innerHTML=total; }
7th Apr 2020, 4:24 AM
Cmurio
Cmurio - avatar
+ 3
TR CodeWorld [AYUSH.ks] Just remove toString() and it work fine.
7th Apr 2020, 5:45 AM
A͢J
A͢J - avatar