Back to Content

HTMLButtonElement: formTarget property

files/en-us/web/api/htmlbuttonelement/formtarget/index.md

latest1.1 KB
Original Source

{{APIRef("HTML DOM")}}

The formTarget property of the {{domxref("HTMLButtonElement")}} interface is the tab, window, or iframe where the response of the submitted {{HtmlElement("form")}} is to be displayed. It reflects the value of the {{HTMLElement("button")}} element's formtarget attribute.

The value overrides the {{domxref("HTMLFormElement.target", "target")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the button. This property can be retrieved or set. If not set, the value is the empty string ("").

Value

A string.

Examples

js
btnEl.formTarget = "_self";

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLButtonElement.formAction")}}
  • {{domxref("HTMLButtonElement.formEnctype")}}
  • {{domxref("HTMLButtonElement.formNoValidate")}}
  • {{domxref("HTMLButtonElement.formMethod")}}
  • {{domxref("HTMLFormElement.target")}}
  • Sending form data