I'm trying to manipulate some html which is in a textarea (not part of the page) but I want to be able to perform jQuery functions on it.
Here I am trying to remove the div with the attr 'my_id' of 1234, but the resulting data remains the same?
var data = "<div>something<div my_id='1224'>blah</div><div my_id='1234'>xx123</div></div>";
var id = '1234';
$(data).remove('[my_id="'+id+'"]');
alert($(data).html());
Obviously just using alert for debugging.