Horje

How to add HTML <area> target Attribute

Use the target attribute to specify where to open the linked document in the image map.

Definition and Usage

The target attribute specifies where to open the linked document.

Only used if the href attribute is present.

Browser Support

Syntax

<area target="_blank|_self|_parent|_top| framename ">

Attribute Values

Value Description
_blank Opens the linked document in a new window or tab
_self Opens the linked document in the same frame as it was clicked
_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 iframe
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>
<h1>The area attribute</h1>
<p>Click on the picture or on one of the planets to watch it closer:</p>
<img src="https://horje.com/avatar.png" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap"> <area shape="rect" coords="0,0,82,126" alt="Sun" href="https://horje.com" target="_blank"> <area shape="circle" coords="90,58,3" alt="Mercury" href="https://horje.com"> <area shape="circle" coords="124,58,8" alt="Venus" href="https://horje.com">
</map>
</body>
</html>

Output should be:

How to add HTML <area> target Attribute




Type :
html
Category :
Web Tutorial
Sub Category :
HTML Tag
Uploaded by :
Admin