Write value from prompt box in document
<p>When visitors visit my page, I want them to prompted with a box, ask their name, and use that name in text. I created a script like this:</p>

<pre><code>function askname() {
var x=prompt("What is your name?","");
}
</code></pre>

<p>I placed that script between the head tags. Then, I write <code>&lt;body onload="askname()"&gt;</code>. The box prompted successfully.
Now, I want to use that 'x' in text. First, I just wrote</p>

<pre><code>&lt;script type="text/javascript"&gt;document.write(x)&lt;/script&gt;
</code></pre>

<p>But it does not work at all! Is there another method to do this? I plan to not using any javascript library, though. So I beg your help. Sorry if this is kind of stupid question, I'm newbie in JS. And sorry for my bad english, too...</p>
