Read value from a textbox
<p>I have a simple textbox:</p>

<pre><code>&lt;input type="text" id="username" /&gt;&lt;br /&gt;
&lt;input type="button" id="Submit" value="Submit" onclick="Submit()" /&gt;
</code></pre>

<p>The function is defined as:</p>

<pre><code>function Submit() {
   var username = document.getElementById("username").value;
   alert("Welcome " + username);
}
</code></pre>

<p>Why do I get the error below?</p>

<blockquote>
  <p>Cannot read property 'value' of null</p>
</blockquote>
