<div class="htmlarea"> <textarea id="runcode23402"> <title>Test</title> <script type="text/javascript"> var str="0101,0102,0103,0104"; function test() { alert("test"); result=str.split(","); result.splice(2,1); alert(result.join("-")); } </script> </textarea><br><input onclick="runEx('runcode23402')" type="button" value="运行代码"> <input onclick="doCopy('runcode23402')" type="button" value="复制代码"> <input onclick="doSave(runcode23402)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br>比较简单的删除数组中数据操作,更详细的可以参考<br><a href="http://www.jb51.net/article/21505.htm">http://www.jb51.net/article/21505.htm</a>