Killercode
Killercode

Reputation: 904

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 "active" 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?

Upvotes: 0

Views: 1105

Answers (1)

lonesomeday
lonesomeday

Reputation: 238095

Just use the class selector:

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

Upvotes: 6

Related Questions