HTML Form Attributes

What are Form Attributes?

Form attributes define how a form behaves and where data is sent.

Example

<form action="submit.php" method="post" target="_blank">

  <label>Name:</label><br>
  <input type="text" name="name"><br><br>

  <label>Email:</label><br>
  <input type="email" name="email"><br><br>

  <button type="submit">Submit</button>

</form>
Try it Yourself

action

Where form data is sent

method

GET or POST method

target

Where response opens

Live Preview

Summary