Hide all elements except one div and its child element

前端 未结 4 1765
陌清茗
陌清茗 2020-12-11 04:43

How to hide all elements except one div and its child element using jquery?

4条回答
  •  生来不讨喜
    2020-12-11 05:23

    Simple solution: hide all and then show the one(in this case the second div and its children).

    $('.create-account').children().hide();
    $('.create-account>div:nth-of-type(2)').show();
    

提交回复
热议问题