Assuming that the html contains the following structure:
Put an id on it, e.g.
...
^^^^^^^^^^^^^^
then the JS is simply
document.getElementById('the_a_tag').href = 'new address goes here';
as long as you put the javascript AFTER the relevant HTML.
And note: CSS is for presentation only. With a few exceptions, it cannot affect the content of document elements, merely how they appear (color/size/position/etc...).