+ 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
3 ответов
+ 3
https://code.sololearn.com/WellF79n8Bhg/?ref=app
+ 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;
}
+ 3
TR CodeWorld [AYUSH.ks] Just remove toString() and it work fine.