I'm trying to pull some information using the wikipedia API. The response is a mega-string with all of the HTML for a section. In the response, I'm wanting to extract the first 3 li's out of the first ul, and preferably don't want to write it to document until I'm done extracting.
I've been tinkering with different combinations of jquery functions, but haven't had much luck. What made the most sense to me was something like:
var markup = $('<div>' + response + '</div>').find('ul:lt(3)').html();
$('body').append(markup);
Only the :lt() filter only seems to apply to the ul and not the li's even though .find() only selects the descendants. I'm probably overthinking this, but do you guys have any ideas?