modifying global javascript variables and accessing them in the HTML
<p>I'm very new to fiddling with javascript - but here is what I'm trying to accomplish.</p>

<p>I have code like such:</p>

<pre><code>    $('#numberItems').keyup(function () {
      var num = parseInt($(this).val());
      var price = parseInt($('#price').text());
      var.cost = num * price
      $('#total').text(cost);
    }).keyup();
</code></pre>

<p>This really works fine for what I'm doing - but what I'd like to do is take the cost variable and stick it in a link - such as:</p>

<pre><code>&lt;a href="http://www.google.com/&lt;script&gt;document.write(cost)&lt;/script&gt;"&gt;Googly&lt;/a&gt;
</code></pre>

<p>I realize, to make the variable global, I need to stick outside of the function, but then how do my calculations save to it?</p>
