日期:2014-05-16 浏览次数:20349 次
alert($('#showselect div').map(function(){
return $(this).find('span').text()+':'+$(this).find('label').text()
}).get().join());
var selectedInfo = $(".selectedInfo");
var result = "";
for(var i=0,len = selectedInfo.length;i<len;i++){
span = selectedInfo.eq(i).children("span:eq(0)").html();
label = selectedInfo.eq(i).children("label:eq(0)").html();
if(i==0){
result = span+":"+label;
}else{
result += ","+span+":"+label;
}
}
alert(result);
var $a = $("#showselect div");
var $b = $.map($a,function(k,v){
return $(k).find('span').text() + ':' + $(k).find('label').text();
});
alert($b.join());