jquery - Select children under the css pseudo class selector -


i'm using bootstrap tabs, both directly under <body>, , inside .modal. need select tabs not inside .modal via css. doesn't work:

var act = $("div:not(.modal) ul.nav li"; 

intead of disregarding .modal contents, selects tabs inside .modals. known limitation, achievable? there workaround this?

<body>     <div>         ...         <!--  more nested on actual code-->         <ul class="nav nav-tabs" role="tablist">             <li role="presentation" class="active">                 <a href="#" data-toggle="tab">tab 1</a>             </li>             <li role="presentation">                 <a href="#" data-toggle="tab">tab 2</a>             </li>         </ul>     </div>     ...     <div class="modal fade lookup" id="search-adjustment-report-header-modal">         <div class="modal-dialog">             <div class="modal-content">                 <div class="modal-body">                     ...                     <ul class="nav nav-tabs" role="tablist">                         <li role="presentation" class="active">                             <a href="#" data-toggle="tab">tab 1</a>                         </li>                         <li role="presentation">                             <a href="#" data-toggle="tab">tab 2</a>                         </li>                     </ul>                 </div>             </div>         </div>     </div> </body> 

i need query setting cookies, default tab selected, etc.

var act = $("ul.nav > li:not(div.modal ul.nav > li)");

is working fine: https://jsfiddle.net/ue6jqp23/1/


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -