Oh damn. Sorry I didn't find this out earlier. There is a method called "setAttribute" that lets me do just that. Sorry for the pointless thread.
x = get_object('some_id')
x.setAttribute('style', 'background-color: #000');
EDIT
There's still a problem. It doesn't want to work in Internet Explorer:
http://saney.ath.cx:8080/vle/?page=temp
It works in Firefox. The case for the current situation is supposed to be highlighted.