I have markup that’s returned from an ajax call. The markup isn’t on the page yet. Before I put it on the page, I want to run jquery selections on it, for example to know the id of a certain div, etc.
Is it possible to run jquery selections on a string? I tried for example to do the following in an attempt to get the id of the div that has class myClass, but it’s not working.
$(response).find('.myClass').attr('id')
if that string is a HTML markup string like:
'<div><div class="myClass" id="sameold"></div></div>'then you will get sameold as a value returned