The property is a USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', and the port of the URL.


string =; = string;


var anchor = document.createElement("a");

anchor.href = "" == ""

anchor.href = "" == ""
// The port number is not included because 443 is the scheme's default port

anchor.href = "" == ""


Specification Status Comment
HTML Living Standard
The definition of '' in that specification.
Living Standard Initial definition

Browser compatibility

BCD tables only load in the browser

See also