Categories
Web development

HTML action Attribute

HTML action Attribute

The HTML action attribute defines where to send the form-data when a form is submitted.

The HTML action attribute can be used on the <form> element.

Example:

<!DOCTYPE html>
<html>
<body>

<form action="">
  <label for="first-name">First name:</label>
  <input type="text" id="first-name" name="first-name"><br><br>
  <label for="last-name">Last name:</label>
  <input type="text" id="last-name" name="last-name"><br><br>
  <input type="submit" value="Submit">
</form>

</body>
</html>

Output:






Enjoy coding!

Read also:

HTML Attributes

HTML Media