jquery 获取复选框文本值
var ids = "";$('input:checked').each(function() {ids += $(this).val() + ',';});//得到选中复选框的valuevar texts = "";$('input:checked').each(function() {texts += $(this).parent().text() + ',';});//得到选中复选框的text//去掉最后一个“,”号var str = ids.substring(0, ids.lastIndexOf(","));var textStr = texts.substring(0, ids.lastIndexOf(","));//将text的中文值进行转码var textUtf = encodeURI(encodeURI(textStr));
页:
[1]