【问题标题】:how to get value from hidden input type array using jquery如何使用jquery从隐藏的输入类型数组中获取值
【发布时间】:2015-04-01 11:42:16
【问题描述】:

如何从隐藏输入类型数组中获取值我的输入在下面,我正在尝试这段代码

  <input type="hidden" name="POSITION[]" value="10">
  var arr= $('input[type="hidden"][name="POSITION[]"]').val();

【问题讨论】:

标签: jquery arrays input hidden


【解决方案1】:

试试这个代码

var arr = $('input[type="hidden"][name="POSITION[]"]').map(function(){
  return this.getAttribute("value");
}).get();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-29
    • 1970-01-01
    • 1970-01-01
    • 2011-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多