raffx,
<!DOCTYPE HTML>
<html>
<head>
<style>
.red{
color:red;
}
.green{
color:green;
}
</style>
</head>
<body>
<a href="#" class="red" >link</a>
<script>
var link = document.body.children[0];
link.onclick = function () {
this.className = "green";
return false;
};
</script>
</body>
</html>