Skip to main content

HTML Guide

Bad value “” for attribute “target” on element “area”: Browsing context name must be at least one character long.

Empty target on an <area> element is invalid; it must be a named browsing context (at least one character) or a valid keyword like _self, _blank, _parent, or _top.

The target attribute on hyperlinked elements such as <a> and <area> controls where to open the linked resource. It accepts either a named browsing context (e.g., target="mapFrame") or one of the standard keywords: _self (default, same frame/tab), _blank (new tab/window), _parent, or _top. An empty string "" is not allowed and causes validation errors. Choose the appropriate keyword or remove target if default behavior is desired. If you need to direct links to a specific frame or iframe, use a non-empty name and ensure the frame has a matching name attribute.

HTML Examples

Invalid example (reproduces the error)

<img src="plan.png" usemap="#site-map" alt="Site map">
<map name="site-map">
  <area shape="rect" coords="10,10,100,60" href="/about" alt="About" target="">
</map>

Fixed examples

<!-- Use a valid keyword -->

<img src="plan.png" usemap="#site-map" alt="Site map">
<map name="site-map">
  <area shape="rect" coords="10,10,100,60" href="/about" alt="About" target="_self">
</map>
<!-- Or remove target to use default behavior -->

<img src="plan.png" usemap="#site-map" alt="Site map">
<map name="site-map">
  <area shape="rect" coords="10,10,100,60" href="/about" alt="About">
</map>
<!-- Or target a named iframe -->

<iframe name="mapFrame" src="about:blank" title="Content frame"></iframe>
<img src="plan.png" usemap="#site-map" alt="Site map">
<map name="site-map">
  <area shape="rect" coords="10,10,100,60" href="/about" alt="About" target="mapFrame">
</map>

Learn more:

Related W3C validator issues