I have the following in a jquery script:
if ( path[1] ) {
$('.content_nav a[class$="' + pos1_path + '"]').toggleClass('current');
}
which selects the appropriate element, such as:
<a class='pos1_path' href="#">link</a>
It works, but now I need the same to work when multiple classes are used, like this:
<a class='pos1_path pos2path' href="#">link</a>
How can I achieve this?
SOLVED:
$('.content_nav a[class$="' + pos1_path + ' ' + pos2_path + '"]').toggleClass('current');