You are in page:
» 4. The target attribute
The target attribute
You can also specify where you want your link to be opened using the
target atttribute inside the
<a>
tag of your link.
- Create the following 2 links:
<a href="http://www.scriptingok.com" target="_self">This link opens in the same window</a>
<br />
<br />
<a href="http://www.scriptingok.com" target="_blank">This link opens in a new window</a>
- Preview your file in your browser, and click on both links.
The target
_self is the default target; it will open your linked page in the same window where your source link is. So if you don't specify a target,
_self will be used.
The target
_blank will open your linked page in a new window (or tab, depending on your browser's settings).
Follow into the
next tutorial to learn how to insert images in your web pages.