DOM Interfaces
HTMLAreaElement
Represents a hotspot within an image map, including its shape, coordinates and destination. An area alone does not display an image; associate the map with an image using usemap and provide meaningful alternative text. Example result: rect.
Formal Syntax & Structure
html syntaxhtml
const element = document.getElementById('demo'); // HTMLAreaElementReturn Value
HTMLAreaElement
An existing HTML DOM object associated with the area element in this example; this interface is a type, not a function return contract.
Working Example
Example Snippethtml
<map name="places"> <area id="demo" shape="rect" coords="0,0,20,20" href="#north" alt="North"></map><p> Result: <output id="result"></output></p><script> const e = document.getElementById('demo'); const result = value => { document.getElementById("result").textContent = String(value); }; result(e.shape);</script>