How to use in jQuery :not and hasClass() to get a specific element without a class

后端 未结 5 1765
暖寄归人
暖寄归人 2021-01-31 01:08

I have this line of code:

$(\'#sitesAccordion .groupOfSites\').click(function() {
    var lastOpenSite = $(this).siblings().hasClass(\':not(.closedTab)\');
    c         


        
5条回答
  •  隐瞒了意图╮
    2021-01-31 02:01

    I don't know if this was true at the time of the original posting, but the siblings method allows selectors, so a reduction of what the OP listed should work.

     $(this).siblings(':not(.closedTab)');
    

提交回复
热议问题