change form field value with javascript - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text


change form field value with javascript

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {//w  w  w. j a va2 s.  c o m
form = document.forms[0];
function up(d,mul)
up('field1','Hello field 1');
up('field2','Hello field 2');


      <form method="post" action="doesnt_matter"> 
         <input type="text" name="field1"> 
         <input type="text" name="field2"> 

Related Tutorials