2011-02-01 14 views

Odpowiedz

154
$(this).find('li.target').css("border", "3px double red"); 

lub

$(this).children('li.target').css("border", "3px double red"); 

Użyj children dla bezpośrednich potomków lub find dla głębszych elementów.

+77

Short-ręka dla find: '$ ('li.target', this);' –

+0

wielki odpowiedzi (i też szybko), dziękuję! – deb

+0

znajduje tylko zwrócić pierwsze wystąpienie lub wszystkie wystąpienia? –

7

Używam tego dostać rodzicem, podobnie dla dziecka

$(this).children('li.target').css("border", "3px double red"); 

Powodzenia

Powiązane problemy