$(function(){ $('#div_title li').on('click',function(){ if($(this).css('backgroundColor')=='red'){ $(this).css("backgroundColor",""); }else{ $(this).css("backgroundColor","red"); } });});
试一试这样有没有问题