js数组问题
三个按钮value 分别为(1,2,3); 分别点击按钮往数组里添加value
[解决办法]
- HTML code
<script>var array = [];</script><input type='button' value='1' onclick='array.push(this.value)' /><input type='button' value='2' onclick='array.push(this.value)' /><input type='button' value='3' onclick='array.push(this.value)' /><input type='button' value='show' onclick='alert(array)'/>
[解决办法]