through a list, this is my html code:
<ul class="choix-kit_modele_list">
<li class="first modele"><a href="">Modèle :</a></li>
<li><a href="">A1</a></li>
<li><a href="">A3</a>
<ul class="choix-kit_type_list">
<li class="first type"><a href="">Type :</a></li>
<li><a href="">3 Portes - 1999 à 2003</a></li>
<li><a href="">3 Portes - 2004 à Aujourd'hui</a></li>
<li><a href="">5 Portes - 1999 à 2003</a></li>
<li><a href="">Cabriolet - 2008 à Aujourd'hui</a></li>
<li class="last"><a href="">Sportback - 2005 à Aujourd'hui</a></li>
</ul>
</li>
<li class="last"><a href="">A4 Berline</a></li>
</ul>
I would like to select only of the first level of the list, so this is my code, wich select all :
$('.choix-kit_modele_list li > a').not('.choix-kit_type_list li a').each(function(i){
$(this).css({width: 100});
});
So i said that “select me a of the first ul but not his ul child, via calling them by their respective class. So what’s wrong in my code please ?
Thanks in advance for you help
The child selector should be between
.choix-kit_modele_listandli, because everyais a child oflion all levels: