HTML form action attribute
Examples
When submitting a form, send the form data to a file named "demo_form.html" file (process input):
<form
action="demo_form.html"
method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="提交">
</form>
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="提交">
</form>
try it"
Browser Support
All major browsers support the action attribute.
Definition and Usage
Attribute specifies the action when the form is submitted, where to send the form data.
Differences between HTML 4.01 and HTML5
In HTML5, action property is no longer necessary.
grammar
<form action="URL">
Property Value
值 | 描述 |
---|---|
URL | 当表单提交时向何处发送表单数据。 可能的值:
|
HTML <form> tag