Easy Tutorial
❮ Prop Number Placeholder Dom Obj Input Image ❯

Location port Property


Definition and Usage

The port property is a read-write string that sets or returns the port portion of the current URL.

Note: If the port number is 80 (which is the default port number), it does not need to be specified.

Syntax


Browser Support

All major browsers support the port property.


Example

Return the port number of the current URL:

The output of the above example:


❮ Prop Number Placeholder Dom Obj Input Image ❯