I want to make an AJAX call to an HTML-returning page, extract part of the HTML (using jQuery selectors), and then use that part in my jQuery-based JavaScript.
The A
You can use load on a new element, and pass that to a function:
function handle(element){ $(element).appendTo('body'); } $(function(){ var div = $(''); div.load('/help a', function(){handle(div);}); });
Example: http://jsbin.com/ubeyu/2