日期:2014-05-16 浏览次数:20519 次
<!DOCTYPE HTML>
<html>
<head>
<title> New Document </title>
<meta charset="uft-8">
</head>
<script>
function ceshi(e){
e = e || window.event;
// 阻止submit的默认行为
e.returnValue = false;
if(e.preventDefault){
e.preventDefault();
}
var el=document.getElementById('Sou');
if(el.value == "Sou")
{
window.location = 'http://www.baidu.com'
}else{
document.getElementById('frm').submit();
}
}
</script>
<body>
<form id="frm" action="http://g.cn">
<input style="text" id="Sou" name="ss" value="Sou"><input type="submit" value="SouSuo" onclick="ceshi()">
</form>
</body>
</html>