复制代码 代码如下:
var colorvalues = new array();
$('#image-colors').find('.color-block').each(function(){
if($(this).find('span').eq(0).hasclass('selected')){
colorvalues.push($(this).attr('title'));
}
});
var colorstring = colorvalues.join(',');
alert(colorstring);