x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h1>JavaScript location.port Property</h1>
6
<p id="demo"></p>
7
8
<script>
9
    let port = location.port;
10
    document.getElementById("demo").innerHTML = port;
11
</script>
12
13
</body>
14
</html>