title: JavaScript / Socket.io web application not executing any JS commands
body: <p>I am trying to create a simple live LAN messaging web application.  I am using HTML, CSS, Javascript, Socket.io, and JQuery to do this.  I have built a similar application to this before, so I have some experience with these types of projects.  I have no idea why, but every time I try to execute any javascript command, it doesn't work.  I have a button trying to start a function called joingame().  It says that the function is undefined.  I also tried to define a variable as "test value", and it keeps coming up as ''.  If anybody could help me out, it would be great!  It's probably something really basic, but I can't figure it out.  Thank you!</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;style&gt;
  #start {
  width: 400px;
  height: 120px;
  border: 1px solid black;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translateY(-50%) translateX(-50%);
  }
  
  #chat {
  width: 80%;
  height: 80%;
  border: 1px solid black;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translateY(-50%) translateX(-50%);
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="start"&gt;
  &lt;center&gt;
  &lt;h2&gt;Enter your username below:&lt;/h2&gt;
  &lt;input type="text" placeholder="Username here..." id="usernameid" /&gt;
  &lt;input type="button" value="Submit" onclick="joingame()" &gt;
  &lt;/center&gt;
  &lt;/div&gt;
  
  &lt;div id="chat" style="display: none;"&gt;
  &lt;center&gt;
  &lt;div id="chatbox"&gt;
  &lt;div id="inputarea"&gt;
  &lt;textarea id="chatinp" placeholder="Enter message here..." cols='50' rows='2' /&gt;
  &lt;input type="button" value="Send" onclick="sendchat()" id="sendbut" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/center&gt;
  &lt;/div&gt;
  &lt;script src="socket.io.js"&gt;&lt;/script&gt;
  &lt;script src="jquery-3.2.0.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
  var socket = io();
  var usernameasdf = "test value";
  
  function joingame() {
  usernameasdf = document.getElementById("usernameid").value;
  socket.emit('player', usernameasdf);
  document.getElementById("start").style.display = "none";
  document.getElementById("chat").style.display = "inline";
  }
  
  socket.on('player', function(name) {
  alert(name);
  });
  
  function sendchat() {
  alert("chat sent");
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>