w3resource

HTML action attribute

action

The purpose of the HTML action attribute is to specify the URL of a form processor (for example a PHP script which handles the form data).

Supported elements

HTML action attribute supports form element.

Syntax

<form action="value" >.....</form>

Type of value

Type of value of HTML action attribute is an URL.

Value

A URL containing a form processing script.

Default value

There is no default value of HTML action attribute.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.

Example of HTML action attribute with form

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example of HTML action attribute with form</title>
</head>
<body>
<form action="action.php">
Email id : <input type="text" name="email" /><br />
Password : <input type="text" name="passw" /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>

Result

html-action-attribute-with-form

View this example in a separate browser window

Example of HTML action attribute with form.

Previous: HTML accesskey attribute
Next: HTML align attribute

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.