2009-08-28 14 views

Odpowiedz

32
$(this).prev("div") 

lub

$(this).prev() 

lub

$(this).prev(".resumehint") 

można zastąpić $(this) z $('#resume') jeśli jesteś poza funkcją.

+0

Wygląda źle, prawda? – omg

+1

nie, to prawda – Jason

+0

Tak, jest: http://docs.jquery.com/Traversing/prev –

3

Użyj Traversing/prev funkcję:

$('#resume').prev('div'); 

A jeśli wiemy, że klasa CSS div być bardziej szczegółowe:

$('#resume').prev('div.resumehint'); 
2

dla wielu div:

$('#resume').prevAll() 
Powiązane problemy