See the following code for adding and removing css class from html element by using jQuery:-
<html>
<head>
<title>jQuery Add/Remove css</title>
<style type="text/css">
.highlight {
background:green;
}
</style>
<script type="text/javascript" language="javascript" src="../scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready ( function(){
$("#addCssLnk").click(function (){
$('#p1').addClass('highlight');
});
$("#removeCssLnk").click(function (){
$('#p1').removeClass('highlight');
});
});
</script>
</head>
<body>
<h1>Add/Remove css</h1>
<p id="p1">Welcome to jQuery</p>
<a href="javascript: void(0);" id="addCssLnk">Add Css</a>
<a href="javascript: void(0);" id="removeCssLnk">Remove Css</a>
</body>
</html>