a target Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

The target attribute specifies where to open the linked document.

Attribute Values

Value Description
_blankOpens the linked document in a new window or tab
_self Opens the linked document in the same frame as it was clicked (this is default)
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the window
framename Opens the linked document in a named frame

The target attribute specifies where to open the linked document:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p>Open link in a new window or tab: <a href="http://java2s.com" target="_blank">Visit java2s.com</a></p>

</body><!--   w ww  .j  a va  2s  .  c om-->
</html>

Related Tutorials