The AJAX response returns a list of <a> elements:
<a href="/1/">One</a>
<a href="/2/">Two</a>
<a href="/3/">Three</a>
How do I select only the first n a elements from the response?
$.ajax({
url: '/' + page,
success: function (res) {
btn.after($('a', $(res)).slice(0,20));
}
});
That's what I'm currently trying but I'm getting a Uncaught Error: Syntax error, unrecognized expression followed by the whole response.