title: JQuery toggle VAT switching
body: <p>I want to implement a VAT switcher as you can see on <a href="http://www.aria.co.uk" rel="nofollow noreferrer">http://aria.co.uk</a> top right corner although I  want to do it on the client side only.</p>
  
  <p>Below is something I came up with, although I need to:</p>
  
  <ul>
  <li>switch VAT back and forth (my example goes just one way)</li>
  <li>save and read the toggled state from a cookie for persistency</li>
  <li><p>have it unobtrusive / display the switch link only if JS is available </p>
  
  <p><code>&lt;html&gt;</code></p>
  
  <p><code>&lt;head&gt;</code></p>
  
  <p><code>&lt;title&gt;VAT Switch&lt;/title&gt;</code></p>
  
  <p><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"&gt;&lt;/script&gt;</code></p>
  
  <p><code>&lt;script type="text/javascript"&gt;</code></p>
  
  <p><code>function VATswitch(){</code></p>
  
  <p><code>var price = $(".price strong span").text();</code></p>
  
  <p><code>price = price * 10  / 12;</code></p>
  
  <p><code>$(".price strong span").text(price);</code></p>
  
  <p><code>var excl_incl = $(".price em").text();</code></p>
  
  <p><code>excl_incl = "(excl. VAT)";</code></p>
  
  <p><code>$(".price em").text(excl_incl);</code></p>
  
  <p><code>}</code>
  <code>&lt;/script&gt;</code></p>
  
  <p><code>&lt;/head&gt;</code></p>
  
  <p><code>&lt;body&gt;</code></p>
  
  <p><code>&lt;a href="#" onclick="VATswitch();" id="vat_switch"&gt;Switch VAT&lt;/a&gt;</code></p>
  
  <p><code>&lt;p class="price"&gt;</code></p>
  
  <p><code>&lt;strong&gt;£&lt;span&gt;120&lt;/span&gt;&lt;/strong&gt;</code></p>
  
  <p><code>&lt;em&gt;(incl. VAT)&lt;/em&gt;</code></p>
  
  <p><code>&lt;/p&gt;</code></p>
  
  <p><code>&lt;/body&gt;</code></p>
  
  <p><code>&lt;/html&gt;</code></p></li>
  </ul>
  
  <p>Please help.</p>