javascript - Return value of hidden field with jQuery -


i'm building kind of e-commerce site jcart school project. following:

i value of hidden field , return @ location on same page.

while browsing stack overflow found code value of hidden:

<script> var subt = $('#jcart-subtotal').val();</script> 

this works expected. checked using alert(subt).

i tried return(subt); instead of alert, because want value printed on page itself, not shown in alert message.

how should print value instead of have shown in alert popup?

put wherever want show value on page:

<span id='showme'></span>  

javascript

$('#showme').html($('#jcart-subtotal').val()); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -