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

HTML DOM Base target attribute

Base target attribute

Base Object Reference Base Object


Definition and Usage

The target attribute sets or returns the value of the target attribute in the base element.

The target attribute specifies where to open all links in the page.

Syntax

baseObject.target=

value

The target attribute can be one of the following values:

Value Description
_blank Open the link in a new window
_self Open the link in the same frame (default).
_parent Open the link in the parent frame
_top Open the link in the window document.
framename Open the link in a specified frame

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the target property.


Example

Example

Return the target attribute of the base link for all links in the page:

Runoob Tutorial(runoob.com)

Base link for all links:

The example above produces the following output:

Base link for all links: _blank

Try it »


Base Object Reference Base Object