<div class="htmlarea"> <textarea id="runcode76461"> <title>随机设置表单的发送地址</title> <script language="javascript"> <!-- function send(form){ url = new Array(); url[0] = "http://www.yahoo.com"; url[1] = "http://www.google.com"; url[2] = "http://www.baidu.com"; i = Math.random() * url.length; i = Math.floor(i); form.action = url[i]; alert("发送表单的地址为:"+form.action); } --> </script> <form name="form1" onsubmit="send(this)"> 姓名:<input type="text" name="name"> <input type="submit" value="发送"> </form> </textarea><br><input onclick="runEx('runcode76461')" type="button" value="运行代码"> <input onclick="doCopy('runcode76461')" type="button" value="复制代码"> <input onclick="doSave(runcode76461)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>