How Do I get the value of a span tag and send it into my form to another page?
<span id="subtotal"></span>
I need to send the content of my span tag subtotal to another page, I would like to save it into a hidden field, but I found no way to do this..
I used this, but no success!
function getTotal() {
return alert(document.getElementById('total').innerHTML);
}
Here goes the right function for those who need the answer! After I figured out the script ...
function getTotal() {
//document.write(document.getElementById('total').innerHTML);
var someValue = $(".total").text();
alert("Value is "+someValue);
//It cause to releoad the page and give me the parameter total
location.href="frmAdd.php?total=" + someValue;
}
this will give you value
$("#subtotal").text();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With