更新时间:2023-11-28 22:28:40
VAL
只返回第一个人的价值,尽量地图
加上 GET
加上加入
:
val
only returns the first one's value, try map
plus get
plus join
:
var ignoreMessagesColl = $("input.activityId").map(function() {
return this.value;
}).get().join(",");
什么一样:
地图
遍历所有匹配的元素和无论构建迭代函数返回一个jQuery包裹的阵列。
map
loops through all of the matched elements and builds a jQuery-wrapped array of whatever the iterator function returns.
GET
从jQuery包装得到基本数组(我不知道为什么地图
返回一个jQuery包装)。
get
gets the underlying array from the jQuery wrapper (I have no idea why map
returns a jQuery wrapper).
加入
结合的元素该阵列为分隔给定的分隔符的字符串。
join
combines the elements of the array into a string delimited with the given delimiter.
为您的示例数据的最终结果是, ignoreMessagesColl
将579578577
。
The end result for your example data is that ignoreMessagesColl
will have "579,578,577"
.