JQuery remove and add span-class

Wetsmoiftitty

New Member
I have two spans with links that a user can click, and when a span is clicked it remove a class and adds another class on the click one:
7gCGH.png
HTML:\[code\]<span class="resCheck label label-success"> <a data-method="get" class="resCheckLink" href="http://stackoverflow.com/questions/15615630/trafikskola?utf8=%E2%9C%93&query=lund& amp;sort=asc">Cheap prices</a></span><span class="resCheck label"> <a class="resCheckLink" data-method="get" href="http://stackoverflow.com/questions/15615630/trafikskola?utf8=%E2%9C%93&query=lund& sort=desc">Expensive prices</a></span>\[/code\]JQuery:\[code\]$(function(){ $('.resCheckLink').click(function(e){ $('.resCheck.label').removeClass('label-success'); $(this).parent().addClass('label-success') });});\[/code\]But it dosent work, it dosent add and remove the classes, how can I fix this?
 
Back
Top