Ok, let me clarify as i explained it horribly.What i wanted to do, i put 2 frames on the page. One frame would have a text area in it, where you can code, and then there would be a button at the top.When you click the button, it will change the rught iframe to a window, and then write what you put at the left side in the document at the write using the method i kinda explained at the top..Anyone?