x
 
<!DOCTYPE html>
<html>
<head>
<script>
function confirmInput() {
  fname = document.forms[0].fname.value;
  alert("Hello " + fname + "!您现在将被重定向到 www.w3School.com.cn");
}
</script>
</head>
<body>
<form onsubmit="confirmInput()" action="http://www.w3school.com.cn/">
  请输入您的姓名:<input id="fname" type="text" size="20">
  <input type="submit">
</form>
</body>
</html>