The Button formTarget property in HTML DOM is used to set or return the value of the formTarget attribute of a button. After submission of the form the formTarget attribute is called. The form data is to be sent to the server after submission of the form.
- It is used to return the formTarget property.
- It is used to set the formTarget property.
buttonObject.formTarget = "_blank | _parent | _self | _top | framename"
- _blank: It is used to load the response in a new window/tab.
- _parent: It is used to load the response in the parent frame.
- _self:It is the default value and used to load the response in the same frame.
- _top: It is used to load the response in the full body of the window.
- framename: It is used to load the response in a named iframe.
Return Value: It returns a string value which represent the place where the response has to be submitted.
Example: This example describes how to set and get the value of formTarget property.
Before clicking on button:
After clicking on button:
- Internet Explorer 10.0
- Google Chrome
- Mozilla Firefox