代表如下:
=============================================================================================
$('.option_dl dd li label').click(function(e){
if ($(this).find("input").attr("type") == "radio") {
$(this).parents(".option_dl").find("label").removeClass("current");
$(this).addClass("current");
$(this).find("input").eq(0).attr("checked", true);
}else if($(this).find("input").attr("type") == "checkbox"){
var isChecked=$(this).find(":checkbox").attr("checked");
if(isChecked){
$(this).removeClass("current");
$(this).find(":checkbox").attr("checked",false);
return false;
}else{
$(this).find(":checkbox").attr("checked",true);
$(this).addClass("current");
return false;
}
}
})
$('.option_dl dd li label').find(":checkbox").click(function(e){
if($(this)[0].checked){
$(this).parent("label").addClass("current");
$(this).attr("checked",true);
e.stopPropagation();
}else{
$(this).attr("checked",false);
$(this).parent("label").removeClass("current");
e.stopPropagation();
}
})
$('.option_dl dd li label').find(":radio").click(function(){
$(this).parent("label").addClass("current");
$(this).attr("checked",true);
})