HTML action Attribute

❮ HTML Attributes

Example

<form action="action.php" method="get">
	<label for="fname">First name:</label>
	<input type="text" id="fname" name="fname"><br>
	<label for="lname">Last name:</label>
	<input type="text" id="lname" name="lname"><br>
	<input type="submit" value="Submit">
</form>

Meaning

The action attribute contains the URL of the server program that will process the contents of the form.

Some browsers also might support a mailto URL, which can mail the results to the specified address.

Otherwise, the delivery of the data in the form is defined by the method attribute.


Standard Syntax

<form action="URL">



Browser Support




Status




Applies to:

The action attribute can be used on the following element:

Element Attribute
<form> action






Attribute Values

Value Description
URL

Value can be

  • An absolute URL - submit to within or another web site ( href="http://www.example.com/index.html")
  • A relative URL - submit to within a web site ( href="index.html")
❮ HTML Attributes