Consider the following html
<button id="button" click="changeClass();">Click Me to change class of div</button>
<div id="firstDIv" class="first">This is a div</div>
Now when you click on button,changeClass javascript function is called in that function you can write the following line to change class of a div
$('#firstDiv').removeClass('first').addClass('second');
If you want to toggle the class you can use toggle function of Jquery.