I'm building a kind of e-commerce site with jCart as a school project. I would like to do the following:
I would like to get the value of a hidden field and return it at another location on the same page.
While browsing Stack Overflow I found this code to get the value of the hidden:
<script> var subt = $('#jcart-subtotal').val();</script>
This works as expected. I checked it by using alert(subt)
.
I tried return(subt);
instead of alert, because I want the value to be printed on the page itself, not shown in an alert message.
How should I do to print the value instead of have it shown in an alert popup?