HTML <button> Tag with the 'formtarget' Attribute

<form>
<!-- ...form contents... -->

<button type="submit" formaction="http://www.PuStudy.Com/resources/html-forms-action.html" formtarget="_blank">
Submit
</button>

</form>

In the above example we add the formtarget attribute to a button control.

About the formtarget Attribute

The formtarget attribute allows you to specify the browsing context to load the destination indicated in the action attribute.

Possible values:

  • _blank
  • _self
  • _top
  • _parent
  • Any string with at least one character that does not start with a U+005F LOW LINE character.

The above values have different meanings based on whether the page is sandboxed or not. See the W3C website for more information on these values and their implications.

About the <button> Element

The <button> element creates a button control in an HTML document.

Any contents of the <button> element appears on the button.

The <button> element can be associated with a form or stand alone by itself (in such case it could have JavaScript attached via the onclick attribute) to make the button actually do something.