action
            收藏:0  
            阅读:36
        
        
        Form action 属性
定义和用法
action 属性可设置或返回表单的 action 属性。
action 属性定义了当表单被提交时数据被送往何处。
语法
		formObject.action=URL 
	
浏览器支持
	![]()
![]()
![]()
![]()
 
所有主要浏览器都支持 action 属性
实例
返回表单提交的 URL :
		<html>
<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname" value="Donald"><br>
Last name: <input type="text" name="lname" value="Duck"><br>
<input type="submit" value="Submit">
</form>
<script>
document.write(document.getElementById("frm1").action);
</script>
</body>
</html>
	<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname" value="Donald"><br>
Last name: <input type="text" name="lname" value="Duck"><br>
<input type="submit" value="Submit">
</form>
<script>
document.write(document.getElementById("frm1").action);
</script>
</body>
</html>
以上实例输出结果:
		form_action.html