HTML <form> action Attribute

❮ HTML <form> tag


<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">


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


Attribute Values

Value Description

Value can be

  • An absolute URL - submit to within or another web site ( href="")
  • A relative URL - submit to within a web site ( href="index.html")
❮ HTML <form> tag