开发者

Find Element with a certain css class

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜