嗨,我试图将数字推入数组,但似乎无法将输入链接到数组,请提供任何帮助
<html>
<body>
<form id="myform">
<input type="text" name="input">
<button onclick="myFunction()">Add number</button>
</form>
<br>
<div id="box"; style="border:1px solid black;width:150px;height:150px;overflow:auto">
</div>
<script>
var number= [];
function myFunction()
{
number.push=("myform")
var x=document.getElementById("box");
x.innerHTML=number.join('<br/>');
}
</script>
</body>
</html>