HTMLAreaElement: target property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ApiRef("HTML DOM")}}

The **target** property of the {{domxref("HTMLAreaElement")}} interface is a string that indicates where to display the linked resource.

It reflects the [target](/en-US/docs/Web/HTML/Reference/Elements/area#target) attribute of the {{HTMLElement("area")}} element.

Value

A string representing the target. Its value can be:

Example

html
<map name="image-map">
  <area href="www.example.com" target="_top" alt="left" />
</map>
js
const areaElement = document.getElementsByName("image-map")[0].areas[0];
console.log(areaElement.target); // Output: "_top"

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLBaseElement.target")}} property
  • {{domxref("HTMLFormElement.target")}} property
  • {{domxref("HTMLAnchorElement.target")}} property