How to change the content of a div dynamically when the input changes?
<pre><code>&lt;input type="text" class="input-text qty" title="Qty" value="1" maxlength="12" id="qty" name="qty" /&gt;
&lt;div id="qtyvalue"&gt;&lt;div&gt;
</code></pre>

<p>There is an input text box on the page. I'm using Javascript to output the qtyvalue to the following div.</p>

<pre><code>var qty =document.getElementById('qty').value;
document.getElementById('qtyvalue').innerHTML = qty;
</code></pre>

<p>Now, if the user enters a number in the text box, the value of qtyvalue will be changed accordingly, and I don't need to refresh the page. How should I change the code?</p>
