JQuery onclick change class (.removeClass() and .addClass())

In this example,I will show How to change class name using Jquery .removeClass() and .addClass() property.

Syntax:
.removeClass(className)
className will be One or more classes to be removed from the class attribute of each matched element.
Example:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>onclick change class jquery</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style>
.black{
color:#000000;
}
.blue{
color:#0000FF;
}
.red{
color:#FF0000;
}
</style>
<script>
$(document).ready(function(){

$('.Blue').click(function() {
$('#span_id').removeClass().addClass('blue');;

});
$('.Red').click(function() {
$('#span_id').removeClass().addClass('red');;
});

});
</script>
</head>
<body>
<span id="span_id" class="black"><b>Testing jquery onclick change class Example  <br />Hello!!!</b></span>
<ul>
   <li class="Blue">Blue; 
  </li>
   <li class="Red">Red; 
</li>
</body>
</html>