Update form value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Update form value

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {/* ww w  .  j av a2  s  .  c om*/
        var count = 0;
        doClick = function ()
        {
            count++;
            document.frm.COUNTER.value = count;
        }
    });

      </script> 
   </head> 
   <body> 
      <form name="frm" action=""> 
         <input name="COUNTER" value="0"> 
         <a href="#" onclick="doClick();">Click Here</a> 
      </form>  
   </body>
</html>

Related Tutorials