How to hide all elements except one using jquery?

后端 未结 4 1725
一生所求
一生所求 2020-12-02 08:31

I have HTML page:



  
&
4条回答
  •  -上瘾入骨i
    2020-12-02 08:56

    A nice general approach:

    $('#the_id').siblings().hide()
    $('#the_id').parents().siblings().hide()
    

    Works for any element type.

提交回复
热议问题