Area.target

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

document.links[num].target

Description

The target property contains the name of target window or frame in which the URL should be displayed. This property is a read/write string.

Example

In Listing 7.20, a truck parts site is created that allows the user to find out what parts the store carries. The target of the spark plugs and tires link is modified to make the information appear in a new browser window.

Listing 7.20 Modifying the target Property of an Area Object
 <html> <body> <center><h1><u>Wild Bill's Truck Parts</u></h1></center> <h3>Choose Part from Pictures.</h3> <map name="partsMap"> <area name="sparkPlug" coords="1,1,48,48" href="#SPARKPLUGS" target="_top"> ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.