The HTML contains:
<p id="hostname"></p>
<button type="button" onclick="sendHostname()">Submit</button>
The Javascript has:
function sendHostname() {
var hostname = document.getElementById("hostname").innerText;
You have a blank paragraph with the id of
"hostname"
, but it does not contain any
innerText
.