<div class="htmlarea"> <textarea id="runcode23046"> <title>检查是否为URL</title> <script language="javascript"> function check(){ str = form1.txt.value; str = str.match(/http:\/\/.+/); if (str == null){ alert('你输入的URL无效'); return false; }else{ alert("你输入的URL有效"); return true; } } </script> <form name="form1" onsubmit="return check()"> <input type="text" name="txt"> <input type="submit" value="检验"> </form> </textarea><br><input onclick="runEx('runcode23046')" type="button" value="运行代码"> <input onclick="doCopy('runcode23046')" type="button" value="复制代码"> <input onclick="doSave(runcode23046)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>