HTMLButtonElement: formTarget property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{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](/en-US/docs/Web/HTML/Reference/Elements/button#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