Anchor origin Property
Return the protocol, hostname and port number of a link:
The result of x will be:
Try it yourself »
Definition and Usage
The origin property returns the protocol, hostname and port number of the href attribute value.
Note: If the port number is not specified in the URL (or if it is the scheme's default port - like 80, or 443), some browsers will not display the port number.
Note: This property is read-only.
The origin property is supported in all major browsers, except Internet Explorer.
Note: The origin property is not supported in Opera version 12 (and earlier).
|Return Value:||A String, representing the protocol (including ://), the domain name (or IP address) and port number (including the colon sign (:) of the URL. For URL's using the file: protocol, the return value differs between browsers|
Thank You For Helping Us!
Your message has been sent to W3Schools.