The last line of my code is jquery. It works, but I'm trying to find the pure-javascript equivalent
jQuery
var previewFrame = document.getElementById('my_iframe'),
preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
preview.open();
preview.close();
style = document.createElement( 'style' );
style.type = 'text/css';
style.id = 'xmain_css1';
$('#my_iframe').contents().find('head').append(style);
.
This is the closest I could come up with for the LAST LINE (Doesn't work):
preview.head.appendChild(style);
Any thoughts?