<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.5.2.js'></script>
<style type='text/css'>
a.selected {
background-color: #ddf;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$('a').click(function() {
$('.selected').removeClass('selected');
$(this).addClass('selected');
});
});
</script>
</head>
<body>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
</body>
</html>