js bind0

$(function(){ $("#ul").on('click','li',function(){ if(!$(this).a

 $(function(){
        $("#ul").on('click','li',function(){
            if(!$(this).attr('s')){
                $(this).css('background','red');
                $(this).attr('s',true);
            }else{
                $(this).css('background','#fff');
                $(this).removeAttr('s');
            }
        })
    })

ttr('s')){ $(this).css('background','red'); $(this).attr('s',true); }else{ $(this).css('background','#fff'); $(this).removeAttr('s'); } }) })

猜你喜欢

转载自www.cnblogs.com/liweiblog/p/8964775.html
今日推荐