<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.js'></script>
<style type='text/css'>
a {
cursor: pointer;
}
.directionsselect {
background-color: black;
color: white;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function() {
$('#outdirections a').click(function() {
$('#outdirections a').removeClass('directionsselect');
$(this).addClass('directionsselect');
})
});
});
</script>
</head>
<body>
<div id="outdirections">
<a>Item</a> <a>Item</a> <a>Item</a> <a>Item</a> <a>Item</a>
</div>
</body>
</html>
The code above is rendered as follows: