title: Javascript comparing variables
body: <p>Hey I am making simple game and getting some functions done but i am not sure what i am doing here wrong. It always alerts "Incorrect" I have made a text box and a button. when button is pressed it calls getAnswer() and compares the variable with whatever was in the textbox. I have feeling i am doing something wrong with assigning the variable textBox. But not sure.</p>
  
  <pre><code>var currentWord = "hi"
  
  
  function getAnswer(){
  var textBox = document.getElementById('answer_box');
  if (textBox == currentWord){
  alert("Correct!");
  }else{
  alert("Incorrect!");
  }
  </code></pre>
  
  <p>the button and text box code</p>
  
  <pre><code>&lt;input type="text" id="answer_box"/&gt;
  &lt;input type="button" value="Submit" onclick="getAnswer();" /&gt;
  </code></pre>