title: Write text inside a div from JavaScript?
body: <p>I have a JavaScript function that uses <code>document.write()</code> to write to the page.  My issue is that when I click the button to call the function, <code>document.write()</code> replaces what I already had with what I am writing.  Is there a way to write text to a specific div from JavaScript?</p>
  
  <p><strong>Here is my HTML code:</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;link href="style.css" rel="stylesheet" type="text/css"&gt;
      &lt;script type="text/javascript" src="javascript.js"&gt;
      &lt;/script&gt;
      &lt;script&gt;
          // Calling the Google Maps API
      &lt;/script&gt;
  
      &lt;script&gt;
          &lt;!-- JavaScript to load Google Maps --&gt;
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div class="content"&gt;
          &lt;div id="googleMap"&gt;&lt;/div&gt;
          &lt;div id="right_pane_results"&gt;hi&lt;/div&gt;this --&gt;
          &lt;div id="bottom_pane_options"&gt;
              &lt;button onclick="todaydate();"&gt;Try It&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>...and my JavaScript code (something I got from the internet just to test):</strong></p>
  
  <pre><code>function todaydate() {
      var today_date = new Date();
      var myyear = today_date.getYear();
      var mymonth = today_date.getMonth() + 1;
      var mytoday = today_date.getDate();
  
      document.write("&lt;h1&gt;" + myyear + "/" + mymonth + "/"+mytoday + "/h1"&gt;);
  }
  </code></pre>
  
  <p>I would like the text to be right below the button.  Any help would be appreciated.  </p>
  
  <p>Thanks,
  Josh</p>