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