let winter = ["applle","orange","grape"];
console.log(winter);
document.getElementById("fruits").innerHTML = winter;
<h1 id="fruits">fruit stall</h1>
为什么它对我不起作用,有人可以帮忙吗......
我希望数组元素作为输出而不是“水果摊”
您的代码完美运行:
let winter = ["applle", "orange", "grape"];
console.log(winter);
document.getElementById("fruits").innerHTML = winter;
<h1 id="fruits"> fruit stall</h1>