yugomartin
New Member
\[code\]$('.button').click(function(){ $(this).toggleClass('clicked') $('.clicked+span').toggleClass('choice');});\[/code\]I've just started learning jQuery and I was playing around with some methods. So when the link with class \[code\].button\[/code\] is clicked, the \[code\]toggleClass\[/code\] adds at the same time the two classes, BUT when I click it again only the \[code\].clicked\[/code\] is removed. The \[code\].choice\[/code\] class remains, despite what I thought.Could someone explain what I'm missing here, and may be how to achieve this - toggle both classes at every click?EDITSorry, here's the code The thing I want to achieve is when you click 'a)' for example, the corresponding line gets highlighted in some way.