HTML DOM port Property
Definition and Usage
The port property sets or returns the port number of the current URL.
Note: If the port number is the default of 80, it is not specified.
Syntax
Example
<html>
<body>
<script type="text/javascript">
document.write(location.port);
</script>
</body>
</html>
|
Output could be:
Try-It-Yourself Demos
Use the port
property of the location object
|