title: HTML javascript get value from input
body: <p>How can I use the value of a form field in a confirmation dialog box that is displayed upon submit, as seen below? </p>
  
  <pre><code>&lt;form action='removefinish.php' method='post' "accept-charset='UTF-8'"&gt;
  Role: &lt;br&gt;
  &lt;select name="role"&gt;
  &lt;option value="" selected="selected"&gt;&lt;/option&gt;
  &lt;option VALUE="Administrator"&gt; Administrator&lt;/option&gt;
  &lt;option VALUE="Employee"&gt; Employee&lt;/option&gt;
  &lt;/select&gt;
  &lt;br&gt;
  &lt;label for='username'&gt;ID: &amp;nbsp;&lt;/label&gt;  
  &lt;br&gt;
  &lt;input type='text' name='username' id='username'/&gt;  
  &lt;br&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;input type='submit' name='Submit' value='Submit' onclick="return confirm('Are you sure to remove ID: ')";/&gt;  
  </code></pre>