jquery slibings选取同级其他元素的实现代码


  本文标签:slibings

复制代码 代码如下:

<script type="text/javascript">
$(function(){
    $("#downloadchartsright .chartstitleopt,#downloadchartsleft .chartstitleopt").click(function(){
        $(this).siblings().removeClass(underline).end().addClass(underline);
    });
})
</script>




比如点击“今日排名”“本周排名”“本月排名”显示底部下划线,可以通过以上jquery代码显示隐藏样式 。