I would like to sanitize a HTML document (created in google docs) so I can publish it on my CMS.
I have the source document in a string, from to , with header, style, b
I believe you can do what you're trying to do, but you're wording it improperly. You can grab the HTML from another document and manipulate it, but you can't manipulate the external document persay. You can grab it using
$.get("url", function() {
//modify stuff here
});
Try like this:
var gdoc = '<html><body><div id="foo">Bar</div></body></html>';
var data = $('<div/>').html(gdoc).find('#foo').html();
alert(data);
Demo.