area target attribute
The target attribute on the area element:
- allows you to specify the targeted browsing context for the linked resource
- target is a specific attribute → can be applied ONLY on the next HTML5 elements: a, area, base, form
Warning: target attribute can be used only if href attribute is present on area element.
Examples
< | attribute | = | "value(s)" | > | Examples | ||
---|---|---|---|---|---|---|---|
8. | target | = | _blank, _self, _parent, _top, a valid browsing-context name | <href="area1.php" alt="area 1" target="_blank"> <href="area1.php" alt="area 1" target="_self"> <href="area1.php" alt="area 1" target="_parent"> <href="area1.php" alt="area 1" target="_top"> <href="area1.php" alt="area 1" target="browsing_context-name"> |
Video demonstration area target attribute
HTML5 area target attribute Tutorial
min | video details |
---|---|
00:00 | video tutorial: target attribute on area element |
00:08 | target attribute on area element allows you to specify the browsing context in which the linked resource will open⁄display |
00:17 | 1. target attribute absent: default value "_self" (browser's default behavior) |
00:23 | the linked resource css.php will open in the current window |
00:27 | 2. adding the target attribute on area element: value ="_blank" |
00:37 | the linked resource css.php will open in a blank new browsing context (a blank new window) |
00:45 | changing browser's settings: opting for new tab instead of new window |
00:50 | the linked resource opened in a new tab instead of a new window |