开发者

Find Element with a certain css class

开发者 https://www.devze.com 2023-02-25 04:52 出处:网络
Greetings I have this structure: <ul id=\"list\" class=\"tabs\"> <li class=\"list\"><a href=\"#tab1\">Dados do Responsável</font></a></li>

Greetings

I have this structure:

<ul id="list" class="tabs">
<li class="list"><a href="#tab1">Dados do Responsável</font></a></li>
<li class="list"><a href="#tab2">Morada e Contactos</a></li>
<li class="list"><a href="#tab3">Opções de Adesão</a></li>
</ul>

and I am using jquery and css to make it look like a tab menu.

the css and I can define the currently selected menu by setting the class "act开发者_高级运维ive" in the li I clicked.

the question is I am trying to find the currently selected li without clicking on it...

I know it can be done using the $("#list").find(), but I don't know how! all I know is that the selected li contains the css class "active"

Can someone help me out with this one?


Just use the class selector:

$('#list').find('.active');
0

精彩评论

暂无评论...
验证码 换一张
取 消