jquery - how to get prev and child -



jquery - how to get prev and child -

i have this

<ul> <li>-</li> <li>-</li> </ul> <table id="foo"> <thead> <tr> <th>-</th> <th>-</th> </tr> </thead> </table>

and select li , th #foo

var controls = $('#foo').find('th').end().prev().find('li').css('background','red');

http://jsfiddle.net/c1kpg3f1/1/

i seek add() , addback(), nil right.

try

$('#foo').find("th").add($('#foo').prev().find('li')).css('background','red'); demo

jquery jquery-selectors

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -