HTML form Tag action Attribute Tutorial

In this section, we will learn what the action attribute is and how to use it.

What is action Attribute in HTML <form> Tag?

Any HTML form at the end should be sent to a directory on a server. The action attribute is used to set that address on the server!

The value of this attribute could be either an absolute or a relative URL.

So at the submit time, the form data will be sent to that address specified in the action attribute.

HTML action Attribute in <form> Tag Syntax:

<form action = “URL-address”> </form>

<form> Tag action Attribute Values

The value we set for the action attribute is a relative or an absolute URL in which the form data should be headed there when it is submitted to a server.

Example: using action attribute in HTML <form> tag

See the Pen test by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply