Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery tabs: how to hide single tab?

How do I hide the tab2? I can add ID to the second li and than hide it with jQuery, but isn't there some way to do it through .tabs directly?

<div id="tabs" style="width:100%">
<ul>
    <li>
        <a href="#tab1">
            Tab 1 Title
        </a>
    </li>
    <li>
        <a href="#tab2">
            Tab 2 Title
        </a>
    </li>
</ul>
<div id="tab1" style="width:100%;">
    content tab1
 ....
like image 303
Kokesh Avatar asked Jul 10 '14 13:07

Kokesh


1 Answers

Try this :

$('[href="#tab2"]').closest('li').hide();
like image 106
Bhushan Kawadkar Avatar answered Oct 05 '22 03:10

Bhushan Kawadkar