<html>
<head>
<title>检查是否为URL_www.jb200.com</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>
</head>
<body>
<form name="form1" onSubmit="return check()">
<input type="text" name="txt">
<input type="submit" value="检验">
</form>
</body>
</html>