Javascript: Applying Style to a Menu Link

I’m noticing that if I use Javascript to apply a color to a text link element, all the CSS styles for that text element disappear (hover, visited, etc.). (See the function below for an example). Reapplying the stylesheet changes nothing - the text keeps the JS assigned color.

function resetStyle(elemId) {
  elem = document.getElementById(elemId); = '#FF0000';

Does anyone know of a way to apply a color to text without losing other assigned styles? It would be great if someone could explain to me why JS is able to override all other CSS styles.