jQuery bug?


var listItems = "<li><a href='#' title='one'>1</a></li><li><a href='#' title='two'>2</a></li><li><a href='#' title='three'>3</a></li><li><a href='#' title='four'>4</a></li>";

var links = $(listItems).find('a'); //This works

var links = $(listItems).find('li'); //This doesn't


Why can I find all the anchors but not listitems?

Does the description for the find method help to explain things?

Get the descendants of each element in the current set of matched elements, filtered by a selector.

yep, thanks for that - so var listItems2 = $(listItems + ‘li’);

my bad, nevermind