<html>
<head>
<style type="text/css">
.style1{
color:red;
}

.style2{
color:blue;
}

</style> </head> <body>
<form name="f">
<a href="#" id="tag1" class="style1" onclick="javascript:changeStyle('1');">Hello</a>
</form>
</body></html><script language="javascript">
function changeStyle(oid){
Element.removeClassName($('tag' + oid),"style1");
Element.addClassName($('tag' + oid),"style2");
}
</script>