Before answering I will ask
Do you have multiple items with same id 'someList'? Its wrong..
Are you using a ready only list? Or normal list whose href="#"?
If href is valid it triggers transition and there is no point in changing class.
I can see 'var $selected ' is having only fucntion scope and itis useless here.
I guess you are trying to do something wrong and complicating it....
Please explain what exactly is the scenario here....
Your markup and the requirement can help us to help u...