title: How to get the value that a HTML textbox holds
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Get Value form Textbox&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form&gt;
              First Name:&lt;input type="text" id="firstname" value="firstname"&gt; Last Name:&lt;input type="text" id="lastname" value="lastname"&gt;
  </code></pre>
  
  <p>This is the script which I believe to be causing problems, I am unsure if this is the correct method to use to get the value of the textbox</p>
  
  <pre><code>            &lt;script&gt;
                  var first_name = document.getElementById("firstname");
                  var last_name = document.getElementById("lastname");
              &lt;/script&gt;
  
              &lt;p&gt;&lt;/p&gt;
              &lt;input type="submit" value="Submit" onclick="my_checker(first_name, last_name);"&gt;
          &lt;/form&gt;
          &lt;script&gt;
              function my_checker(fName, lName)
              {
                  alert("Hello " + fname + " " + lname);
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>