css如何li中选中后加上class属性js控制
<ul> <li class=""pageson"><span>1</span></li> <li><span>2</span></li> <li><span>3</span></li> <li><span>4</span></li> <li><span>5</span></li> </ul>
script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $('ul li').click(function(){ $(this).siblings().removeClass('pageson'); $(this).addClass('pageson'); }) }) </script>