读书人

js数组有关问题

发布时间: 2012-03-22 17:43:57 作者: rapoo

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)'/>
[解决办法]
探讨

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='butto……

读书人网 >JavaScript

热点推荐