jQuery: Making a Favorite button with function?
<p>Right now i made this:</p>

<pre><code>&lt;a href="#" title="[+] Add as favorite"&gt;&lt;div class="addFavorite"&gt;&lt;/div&gt;&lt;/a&gt;
</code></pre>

<p>the class="addFavorite", is a normal grey star.</p>

<p>Then i have another class="AlreadyFavorite", that is a yellow star. </p>

<p>I want to make a function, so when you click on the grey star, it sends an ajax call(?) and then  on success it turns yellow(changing class to AlreadyFavorite).</p>

<p>I know how to make a onclick function that send a ajax call, but how do i change the style/change the image icon to yellow?</p>

<p>CSS:</p>

<pre><code>.addFavorit{
 background: url('../images/addFavorit.png');
 width: 48px;
 height: 48px;

}
.alreadyFavorit{
 background: url('../images/addFavorit_hover.png');
 width: 48px;
 height: 48px;
}
</code></pre>
