x
 
<html>
<head>
<script type="text/javascript">
function confirmInput()
{
fname=document.forms[0].fname.value
alert("您好 " + fname + "!您会被重定向到 www.w3School.org.cn")
}
</script>
</head>
<body>
<form onsubmit="confirmInput()" action="https://www.w3school.org.cn/">
请输入您的名字:<input id="fname" type="text" size="20">
<input type="submit">
</form>
</body>
</html>