- var tmp = document.createElement('iframe');
- document.body.appendChild( tmp );
- var doc = tmp.contentWindow.document;
- doc.open();
- doc.write("<html><body><input type='text'/></body></html>");
- doc.close();
+ var doc = document.getElementById("iframe").contentDocument;
+
+ doc.body.innerHTML = "<input type='text'/>";