How to update onclick value when keyup?
<p>I’m trying to update the function parameter inside <code>onclick</code> when the user inserts a quantity in the input field.</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;input type="text" id="quantity1" class="quantity_class" /&gt;
&lt;input type="submit" id="onclick1" class="quantity_class" value="Add to cart" /&gt;
</code></pre>

<p><strong>JavaScript</strong></p>

<pre><code>$('#quantity1').keyup(function () {
    $('#onclick1').attr('onclick', 'func(1,?)');
});
</code></pre>

<p>Now how can I replace <code>?</code> with the quantity value the user provided?</p>

<p><a href="http://jsfiddle.net/ruslyrossi/UA5By/5/" rel="nofollow">jsFiddle</a></p>
