JQuery返回日期值的变化

时间:2014-06-19 14:05:48

标签: jquery

$.post('includes/api_orderupdate.php', { getupate:1, ship:id, country:country, state:state, subtotal:subtotal  },
    function(data){ 
      var updateval=data.split('~~');
      $('#ship_info').text(updateval[0].trim());
      var taxdet=updateval[1];
      alert(taxdet);

    });

我的输出是:

<input type='hidden' class='taxinfo' value='VAT:237.5'><input type='hidden' class='taxinfo' value='supertax:220'>

如何获得此值仅限于VAT:237.5,supertax:220

我不知道如何获得价值。提前谢谢。

2 个答案:

答案 0 :(得分:1)

如果我理解正确,您希望检索每个value元素的input属性:

$('input').each(function() {
    alert($(this).val());
})

答案 1 :(得分:1)

你可以随时map他们:

var values = $('input').map(function(){
    return this.value;
}).get().join(', ');

console.log(values); // VAT:237.5, supertax:220 

http://jsfiddle.net/QRHyc/