js代码
$(function(){
$(".show-labelitem").on("click",function(){
$(this).hide();
$(".hide-labelitem").show();
$("#labelItem").show();
});
$(".hide-labelitem").on("click",function(){
$(this).hide();
$(".show-labelitem").show();
$("#labelItem").hide();
});
$(".label-item").on("click","li",function(){
var id = $(this).attr("data");
var text = $(this).children("span").html();
var labelHTML = "
x "+text+"";if($(this).hasClass("selected")){
return false;
}else if($(".label-selected").children("li").length >= 8){
layer.msg("最多可以选择8个哦");
return false;
}