<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function jump(){
//找到表单
var x = document.getElementById("form1");
alert("现在的action:"+x.action);
x.action = "/event.html";
alert("跳转后的action"+x.action);
alert(x.method);
//提交
x.submit();
}
</script>
</head>
<body>
<form id="form1" action="dom2.html" method="post">
<input type="button" value="提交" οnclick="jump()">
</form>
</body>
</html>
javascript控制表单提交
最新推荐文章于 2023-04-10 19:52:28 发布