利用JS实现在li中添加或删除class属性

$( function() {
    $("#test li").click(function(){
       $("#test li").removeClass("center");
       $(this).addClass("center");
  })
});

 

posted @ 2017-04-11 14:29  岁月淡忘了谁  阅读(7714)  评论(0编辑  收藏  举报