.colormenudiv {
position: absolute;
margin-left: 5px;
margin-top: 5px;
}
#purpleSquare:hover{border-color: #FFFFFF;}
#purpleSquare:active{border-color: #FFFFFF;}
#blueSquare:hover{border-color: #FFFFFF;}
#blueSquare:active{border-color: #FFFFFF;}
#redSquare:hover{border-color: #FFFFFF;}
#redSquare:active{border-color: #FFFFFF;}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Active link</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<style type="text/css">
.menu .active {
color:#ff0000;
}
</style>
</head>
<body>
<ul class="menu">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
</ul>
<script type="text/javascript">
$('.menu a').click(function(){
$('.menu a').removeClass('active');
$(this).toggleClass('active');
});
</script>
</body>
</html>
Meet the power of the jQuery library.
Also, your page does not have a proper DOCTYPE which means it will render in 'Quirks' mode and not 'Standards' mode. In IE this means that a number of things do not work properly. Also, when you add the DOCTYPE, it must be the very first thing on the page or IE will ignore it. No comments or anything else are allowed before the DOCTYPE. http://www.w3.org/QA/2002/04/valid-dtd-list.html