title: Textbox to display function JavaScript
body: <p>I'm having an issue with my first project for the semester. Using JavaScript I'm supposed to create a magic 8 ball simulator. The simulator needs a button that that says "shake it" which, when clicked, displays a random saying from my GetSaying() function in a read only textbox. This is where I get a little lost. How do I go about specifying a textbox I would like the saying to be displayed in?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;Magic 8 Ball!&lt;/title&gt;
  &lt;style type="text/css"&gt;
  /*Styles will go here*/
  
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;button type="button" onclick="Show()"&gt;Shake it!&lt;/button&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
          function Show() {
              document.write(GetSaying());
          }
  
          function GetSaying() {
  
              var pool = ["It is certain", "It is decidedly so", "Without a doubt", 
                          "Yes definitely", "You may rely on it", "As I see it, yes",
                          "Most likely", "Outlook good", "Yes", "Signs point to yes", 
                          "Reply hazy try again", "Ask again later", "Better not tell you now", 
                          "Cannot predict now", "Concentrate and ask again", "Don't count on it", 
                          "My reply is no", "My sources say no", "Outlook not so good", "Very doubtful"];
  
              return (pool[Math.floor(Math.random()*pool.length)]);
          }
  
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>