MDN self-hosted library · e01.org

HTMLAreaElement: target property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

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"