var test_list = []
$("[name=contact_user]:checked").each(function () {
test_list.push($(this).val())
});
var test_str = JSON.stringify(test_list );
console.log(test_str);
本文介绍了一种使用jQuery来收集和处理页面上被选中复选框的方法,通过将选择的数据转换为JSON字符串,便于进一步的数据处理和传输。
var test_list = []
$("[name=contact_user]:checked").each(function () {
test_list.push($(this).val())
});
var test_str = JSON.stringify(test_list );
console.log(test_str);
576
3193
5644

被折叠的 条评论
为什么被折叠?