HTML DOM target Property
Complete Area Object Reference
Definition and Usage
The target property sets or returns where to open the link-URL in an area.
Syntax
areaObject.target=_blank|_parent|_self|_top
|
- _blank - the target URL will open in a new window
- _self - the target URL will open in the same frame as it was clicked
- _parent - the target URL will open in the parent frameset
- _top - the target URL will open in the full body of the window
Example
The following example changes the target of the link in the image-map:
<html>
<head>
<script type="text/javascript">
function changeTarget()
{
document.getElementById('venus').target="_blank"
}
</script>
</head>
<body>
<img src ="planets.gif"
width="145" height="126"
alt="Planets"
usemap ="#planetmap" />
<map name ="planetmap">
<area shape ="circle" coords ="124,58,8"
href ="venus.htm" id="venus" />
</map>
<br />
<input type="button" onclick="changeTarget()"
value="Change target" />
</body>
</html>
|
Try-It-Yourself Demos
Change
the target of a link in an image-map
Complete Area Object Reference
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|