So for example i have two links:
Link 1 Link 2
giving the elements css classes would be a better option. You could do it by using the className property on the object. in doCOlorChange you could write this.className ="newclassName";
this.className ="newclassName";