dee*_*ell 8 html javascript jquery
如何获取span标记的值并将其发送到我的表单到另一个页面?
<span id="subtotal"></span>
Run Code Online (Sandbox Code Playgroud)
我需要将我的span标签小计的内容发送到另一个页面,我想将它保存到隐藏的字段中,但我发现没办法这样做..
我用过这个,但没有成功!
function getTotal() {
return alert(document.getElementById('total').innerHTML);
}
Run Code Online (Sandbox Code Playgroud)
对于那些需要答案的人来说,这是正确的功能!在我弄清楚脚本之后......
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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
33103 次 |
| 最近记录: |