Change where to display the response that is received after submitting a form (open the response in a new window instead of the same frame as it was clicked):
The target property sets or returns the value of the target attribute in a form.
The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
The target property is supported in all major browsers.
Return the target property:
Set the target property:
Value | Description |
---|---|
_blank | Opens in a new window |
_self | Opens in the same frame as it was clicked (default) |
_parent | Opens in the parent frameset |
_top | Opens in the full body of the window |
framename | Opens in a named frame |
Return Value: | A String, representing where to display the response that is received after submitting the form |
---|
Return the value of the target attribute in a form:
The result of x will be:
HTML reference: HTML <form> target attribute