Css onclick change class
<p>I want to change a class when I click.</p>

<p>The class is <code>icon icon_plus</code>, and when i click i want that class to be <code>icon icon_minus-06</code>and if click again back tothe original</p>

<p>My HTML code</p>

<pre><code>&lt;a href="#" id="top-bar-trigger" class="top-bar-trigger"&gt;&lt;i id="icon"    class="icon icon_plus"&gt;&lt;/i&gt;&lt;/a&gt;
</code></pre>

<p>My javascript code :</p>

<pre><code>&lt;script&gt;
$("a.top-bar-trigger").click(ontop);
   function ontop() {

   $("#icon").toggleClass("icon icon_minus-06");
 }
&lt;/script&gt;
</code></pre>

<p>I am very weak with javascript</p>

<p>Thanks for the help.</p>