The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

action attribute | action property

Sets or retrieves the URL to which the form content is sent for processing.

HTML 4.01 Specification, Section 17.3



HTML<element action="p" ... >

p = object.action


Property values

Type: String

the URL to use. If a relative path is specified, the base URL of the document is assumed.

Standards information


Windows Internet Explorer 8 or later. In IE8 Standards mode, the value of the action attribute depends on the context of the reference to the attribute. When read as a Document Object Model (DOM) attribute, action returns an absolute URL. The value specified by the page author is returned when action is read as a content attribute, when the page is displayed in an earlier document compatibility mode, or when the page is viewed with an earlier version of the browser. For more information, see Attribute Differences in Internet Explorer 8.


This example uses the action attribute to post a form to a specified URL.

<!DOCTYPE html>

  <form action="" method="post">
    Enter your name:
    <input name="FName"><br />
    Favorite Ice Cream Flavor:
    <select name="Flavor">
      <option value="Chocolate">
      <option value="Strawberry">
      <option value="Vanilla" selected>
      <input type="submit">

This example uses the action attribute to specify a URL for the mailto protocol.

<!DOCTYPE html>

  <form action="" method="get">
    <input name="subject" type="hidden" value="Widget Product Information Request">
    Enter your full mailing address<br>
    <textarea name="body" cols="40"></textarea>
    <input type="submit" value="Send Request" />

See also




© 2014 Microsoft