Jquery: Hide all children, then show a specific element

后端 未结 7 1749
忘了有多久
忘了有多久 2021-01-03 17:59

I want to hide all child elements in a div. And then show a specific one passed on to the function.

function subDisplay(name) {
   $(\"#navSub\").each(functi         


        
7条回答
  •  萌比男神i
    2021-01-03 18:27

    If you want to hide child div using class.

    1st div
    2nd div
    $(document).ready(function(){ $(".parent_div").on('click',function(){ $j(this).find("div").toggle(); }) })

提交回复
热议问题