Do you know if it's possible to run jQuery on a variable that contains html and not just on the document itself.
Example:
bg.inspectorGetRawHtml = function(){
var c = jQuery("#bg-admin-inspect-wrapper").html();
jQuery(".bg-admin-inspect-state", c).remove();
console.debug(c);
}
So bascially, reading a segment of the pages html into a variable and then performing jQuery manipulation on that string.
If I console.debug the actual jQuery remove, it seems like does the matching, but the var is not manipulated. I know jQuery relies on the DOM, and maybe that's why it's not working, but if anyone has any insight on this.... Edit After lonesomeday's suggestion, here is the code I ended up with:
bg.inspectorGetRawHtml = function(){
var c = jQuery("#bg-admin-inspect-wrapper").clone();
jQuery(".bg-admin-inspect-state", c).remove(); //The ,c specifies what element to work on.
console.debug(c.html());
}