action
On this page
HTML action Attribute (HTML操作属性)
The HTML action attribute specifies where the form-data should be sent when the form is submitted. Its attribute value (URL) determines where the data must be sent after the form submission. The URL can have the following values: (HTML操作属性指定在提交表单时应将表单数据发送到何处。其属性值(URL)确定表单提交后必须将数据发送到何处。URL可以具有以下值:)
absolute URL, which refers to another website link. (-绝对网址,指向另一个网站链接。)
relative URL, which refers to a file within a webpage. (-相对URL ,指的是网页中的文件。)
You can use this attribute only on the <form> element.
Syntax
Syntax (语法)
<form action="URL"></form>
Example of the HTML action attribute:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form action="/form/submit">
<label for="fname">Name</label>
<input type="text" name="FirstName" id="fname" value="Mary"/><br/><br/>
<label for="lname">Surname</label>
<input type="text" name="LastName"id="lname" value="Thomson"/><br/><br/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>
/form/submit (表格提交)
https://example.com/some-page