Dynamically adding and removing HTML classes
A common question,

@elclanrs is right that you probably want a common class for your home anchor tags unless you truly want to style them all differently.

Then you could simply turn off the current active anchor with

$('.homeAnchor.subActive').removeClass("subActive");


Otherwise, you could try and see if this works for you:

$('.subActive').removeClass("subActive");


That assumes that on the whole page you use subActive only for your home anchors of course.