title: Get java script variable in HTML
body: <p>I want to get variable value in hidden HTML field. My code like:</p>
  
  <pre><code>&lt;script lang=”text/javascript”&gt;
     Var counter;
     Loop{
       Some Code . . . . 
       Counter++;
     }//end loop
  &lt;/script&gt;
  
  &lt;html&gt;
     &lt;body&gt;
        // some code 
        &lt;input type “hidden” name=”total” id=”total” value=”here I want to get Counter”&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>