Area origin attribute

Definition and Usage

origin This property returns href attribute value protocol, hostname, and port number.

href This property specifies the destination of the link within the area.

Note:If the port number is not specified in the URL (or if it is the default port of the scheme - for example, 80 or 443), some browsers will not display the port number.

Note:This property is read-only.

See also:

JavaScript Reference Manual:location.origin property

Example

Protocol, hostname, and port number of the URL for a specific area in the image map:

var x = document.getElementById("venus").origin;

Try it yourself

Syntax

areaObject.origin

Technical Details

Return value:

String value, representing the protocol (including ://), domain (or IP address), and port number (including the colon : of the URL).

For URLs using the file: protocol, the return values differ among different browsers.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported Not Supported Supported Supported Supported