title: Display the result of a javascript function in a div element
body: <p>I have a Javascript function which does the following:</p>
  
  <ul>
  <li>It takes the value from an list box which the user selected and assigns the value to a variable</li>
  <li>It then takes the number the user selected in a listbox and stores it in a variable.</li>
  <li>It then multiplies the value with the number to get the total </li>
  <li>Finally it adds 15% vat to the total</li>
  <li>The grand total is then displayed in an alert box</li>
  </ul>
  
  <p>However instead of displaying the result in an alertbox I would like to display the result in an DIV element on the webpage under the form. Any ideas how I can accomplish this?</p>
  
  <p>My code looks as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function calc()
  {
  var total = 0;
  var course = 0;
  var nrOfLessons = 0;
  var vat = 0;
  
  course = Number(document.getElementById("course").value)
  nrOfLessons = Number(document.getElementById("nrOfLessons").value)
  
  total =(course * nrOfLessons)
  vat = total * 0.15
  total = total+ vat;
  window.alert(total)
  }
  &lt;/script&gt;
  
   &lt;form id="booking"&gt;
   &lt;strong&gt;COURSE: &lt;/strong&gt;
   &lt;select id="course"&gt;
   &lt;optgroup label="English Courses"&gt;
   &lt;option value="500"&gt;Beginner English&lt;/option&gt;
   &lt;option value="700"&gt;Mid-Level English&lt;/option&gt;
   &lt;option value="1000"&gt;Business English&lt;/option&gt;
   &lt;/optgroup&gt;
   &lt;optgroup label="Thai Courses"&gt;
   &lt;option value="500"&gt;Introduction to Thai&lt;/option&gt;
   &lt;option value="700"&gt;Pasa Thai&lt;/option&gt;
   &lt;option value="1000"&gt;Passa Thai Mak&lt;/option&gt;
  &lt;/optgroup&gt;
  
  &lt;/select&gt;
  
  &lt;select id="nrOfLessons"&gt;
  &lt;option value="5"&gt;5&lt;/option&gt;
  &lt;option value="6"&gt;6&lt;/option&gt;
  &lt;option value="7"&gt;7&lt;/option&gt;
  &lt;option value="8"&gt;8&lt;/option&gt;
  &lt;option value="9"&gt;9&lt;/option&gt;
  &lt;option value="10"&gt;10&lt;/option&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>Thanx in advance for all the help</p>