如何实现将表单内容存进一个字符串数组变量?

如何实现将表单内容存进一个字符串数组变量?
比如E-MAIL中的“CC”中输入多个地址时,如何用数组变量获取?

---------------------------------------------------------------

1<script>   
2var str="[email protected],[email protected],[email protected]"   
3var theemail=str.split(",")   
4alert(theemail)   
5</script>

---------------------------------------------------------------

这里theemail已经是一个数组,可以使用theemail[0]、theemail[1]、theemail[2]访问

Published At
Categories with Web编程
Tagged with
comments powered by Disqus