How to copy and output text from another textbox with Javascript?
<pre><code>&lt;input type="hidden" id="prevTicketNo" value="6"/&gt;

&lt;script&gt;
  var ticketNo = document.getElementById(prevTicketNo).value +1;
  document.getElementById('currentTicketNo').value = ticketNo;
&lt;/script&gt;

&lt;input id="currentTicketNo" value=""/&gt;
</code></pre>

<p>What I am trying to do:
The prevTicketNo is a value captured from somewhere else. I need that to load as a hidden field so I used type="hidden". Once the value in this textbox is loaded, I need to +1 so that the number increases for my current ticket.</p>

<p>Is the right approach?</p>
