jQuery Sales Tax
<p>I have created a function (see below) that calculates a 7.5% sales tax. Now I need help doing the following:</p>

<ul>
<li><p>Have totalTax() take in 2 arguments
one for the price and one for the
tax.</p></li>
<li><p>On submit (use the onSubmit event
handler to call this function) have
the function process the price and
the tax by manipulating the arguments
you passed in. </p></li>
<li><p>Have the sales tax on the page update
dynamically with what ever the sales
tax is that you defined for the
function 
7.5 percent sales tax:</p>

<p>Instead of using .innerHTML use
jQuery to access these document
elements and write to them:</p>

<pre><code>   document.getElementById('requestedAmount' ).innerHTML = priceInput;  
   document.getElementById('requestedTax' ).innerHTML = salesTax;   
   document.getElementById('requestedTotal' ).innerHTML = totalAmount;
</code></pre></li>
</ul>

<p>Original Code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$().ready(function() {
    // validate the comment form when it is submitted
    $("#inputForm").validate(); 
    $("#priceInput").priceFormat({
    prefix: '',
    limit: 5,
    centsLimit: 2
}); 
});

function totalTax(){
  var priceInput = document.getElementById( 'priceInput' ).value;
  var salesTax = Math.round(((priceInput / 100) * 7.5)*100)/100;
  var totalAmount = (priceInput*1) + (salesTax * 1);

  document.getElementById( 'requestedAmount' ).innerHTML = priceInput;
  document.getElementById( 'requestedTax' ).innerHTML = salesTax;
  document.getElementById( 'requestedTotal' ).innerHTML = totalAmount;
}
&lt;/script&gt;

&lt;body&gt;
&lt;form class="cmxform" id="inputForm" method="get" action=""&gt;
  &lt;p&gt;
    &lt;label for="priceInput"&gt;Enter the price: &lt;/label&gt;
    &lt;input id="priceInput" name="name" class="required"/&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &lt;input class="submit" type="submit" value="Submit" onclick="totalTax();"/&gt;
  &lt;/p&gt;
&lt;/form&gt;
&lt;div&gt;Entered price:
  &lt;p id="requestedAmount"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;7.5 percent sales tax:
  &lt;p id="requestedTax"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;Total:
  &lt;p id="requestedTotal"&gt; &lt;/p&gt;
&lt;/div&gt;
</code></pre>
