Have a invoice amount generated by a plugin on page. I want to copy its id into a form field in order to pre-fill it.
<div id="invoicediv">$123.00</div>
<div id="price"></div>
<br />
<form a`ction="https:/thecart.com" method="post" accept-charset="utf-8">
<label>Donation Amount:</label><br>
$<input id="txtBox" size="3" type="text" name="dollaramount">
<input type="hidden" name="name" value="Donation">
<input type="submit" value="Donate">
</form>
jQuery that works:
$('#price').html($('#invoicediv'));
but form doesn't:
$('#txtBox').val($('#invoicediv'));
I also want to remove the dollar sign before it copies itself to the form.
I have the following code so far at http://jsfiddle.net/yvTNc/24/ as well.