title: How to change form element values in HTML
body: <p>I have this piece of simple code.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
    &lt;script type="text/javascript"&gt;
      function changeText()
      {
         var form = document.forms['detail'];
         form.desc.value="success";
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form name="detail"&gt;
      &lt;input type="text" name="desc" id="desc" &gt;
      &lt;input type="submit" value="changetext" onClick=changeText()&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When i run this in Mozilla browser the value of the textbox named "desc" changes but disappears immediately...i.e it is not shown forever and becomes empty.</p>
  
  <p>How can I fix it.</p>
  
  <p>Regards,
  Vijay</p>