Jquery: Hide all children, then show a specific element

后端 未结 7 1705
忘了有多久
忘了有多久 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条回答
  • 2021-01-03 18:37

    if the name of the element is passed in name use this:

        if($(this).attr('name') != name){
        //Hide it
        } else {
       //show it
    }
    
    0 讨论(0)
提交回复
热议问题