title: show form elements using javascript
body: <p>Can anyone please help me through this....
  I have two input fields in my form . One of which is hidden and I want to show it using a button. Now when i tried to show it using onClick() function its not responding...</p>
  
  <p>can anyone give me code snippet to do so....</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script&gt;
  function show()
  {
  document.getElementById('passwd').style.display="block" ;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="demo.html" &gt;
  &lt;input type="text" name="user" /&gt;
  &lt;br /&gt;
  &lt;input type="text" id="passwd" name="password"  style="display:none;" /&gt;
  &lt;input type="button" onClick="show()" name="show" value="show" /&gt;
  &lt;br /&gt;
  &lt;input type="submit" value="OK" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>plz help</p>