$( function() { $("#test li").click(function(){ $("#test li").removeClass("center"); $(this).addClass("center"); })});
利用JS实现在li中添加或删除class属性
原文:http://www.cnblogs.com/henuyuxiang/p/6693402.html