port property (location, a, area)
Sets or retrieves the port component of the URL assigned to the object.
Use the host property to get the host name, or the hostname property for the host name and port number.
You can find the related objects in the Supported by objects section below.
This property is read/write.
String (number in string format) that specifies or retrieves the port component.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the port property for an anchor:
Did you find this example helpful?
User Contributed Comments