For what it's worth, Here's my code sample...
var newsletterForm = document.getElementById("--placeholderID--");
function removeStyles(el) {
el.removeAttribute('style');
if(el.childNodes.length > 0) {
for(var child in el.childNodes) {
/* filter element nodes only */
if(el.childNodes[child].nodeType == 1)
removeStyles(el.childNodes[child]);
}
}
}
function removeElem(selector, scope){
scope = scope || document;
var nodeList = scope.querySelectorAll(selector),
nodeLength = nodeList.length;
while (nodeLength > 0){
nodeList[nodeLength-1].parentNode.removeChild(nodeList[nodeLength-1]);
nodeLength--;
}
}
function removeClass(el, theClass){
if (el.classList){
el.classList.remove(theClass);
} else {
el.className = el.className.replace(new RegExp('(^|\\b)' + theClass.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
}
}
function addClass(el, theClass){
if (el.classList){
el.classList.add(theClass);
} else {
el.className += ' ' + theClass;
}
}
MktoForms2.loadForm("//app-sj01.marketo.com", "###-XXX-###", ####, function(frm){
// Strip styles
removeElem("style", newsletterForm);
removeElem("#mktoForms2BaseStyle");
removeElem("#mktoForms2ThemeStyle");
removeStyles(newsletterForm);
// Strip extra elements
removeElem(".mktoAsterix");
removeElem(".mktoOffset");
removeElem(".mktoGutter");
removeElem(".mktoClear");
// Set class
removeClass(newsletterForm, "pre-render");
addClass(newsletterForm, "rendered");
});