日期:2014-05-16  浏览次数:20331 次

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……