<script type="text/javascript"> function Test() { var w=window.open() w.document.writeln('Text...') } </script> <input type="button" value="Test" onclick='Test()' />