Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Form target property

Form target property

Form Object Reference Form Object


Definition and Usage

The target property is used to set or return the value of the target attribute of the form.

The target property specifies where to open the action URL of the form.

Syntax

formObject.target=

value

The target attribute can be the following values:

Value Description
_blank Open a new window
_self Loads the target document in the same frame or window.
_parent Loads the document into the parent window or the frameset containing the frame that holds the hyperlink reference.
_top Loads the document into the window containing the hyperlink, replacing any frames currently displayed in the window.
framename Open the window in a frame with the same name

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the target property.


Example

Example

Return the action URL that is opened:

First name:

Last name:

The output result of the above script:

_blank

Try it »


Form Object Reference Form Object