Hello. Right now i made this:
<a href="#" title="[+] Add as favorite"><div class="addFavorite"></div></a>
the class="addFavorite", is a normal grey star.
Then i have another class="AlreadyFavorite", that is a yellow star.
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).
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?
CSS:
.addFavorit{
background: url('../images/addFavorit.png');
width: 48px;
height: 48px;
}
.alreadyFavorit{
background: url('../images/addFavorit_hover.png');
width: 48px;
height: 48px;
}