Skip to content

Instantly share code, notes, and snippets.

// JavaScriptを含んだHTMLを評価して返す
function evaluateHTML(html) {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
var d=iframe.contentWindow.document;
d.open();
d.write(html);
d.close();
var result = d.body.innerHTML;
document.body.removeChild(iframe);