Skip to content

Instantly share code, notes, and snippets.

@teer823
Created March 28, 2022 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teer823/df98f4047d3d0eff5940e42fcc8ae017 to your computer and use it in GitHub Desktop.
Save teer823/df98f4047d3d0eff5940e42fcc8ae017 to your computer and use it in GitHub Desktop.
Simple HTML with Vanilla Javascript show hostname
<html>
<head>
<title>Test</title>
</head>
<body>
<span> Hostname : </span><span id="hostname">Hostname</span>
</body>
<script>
item = document.getElementById('hostname');
item.innerText = window.location.hostname
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment