Open a blank window, write to it, and select the written text
<p>I'm trying to open a blank window with Javascript, write text to it, and then select the text that I wrote, all automatically.</p>

<p>I have:</p>

<pre><code>var myWindow=window.open('');
myWindow.document.write("hey");
myWindow.select();
</code></pre>

<p>which opens the window and writes the text, but does not select it.</p>
