$('#x').click(function(){
$('#x').removeClass('linex').addClass('line');
})
.line {
color: red;
}
.linex {
color: blue;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id='x' class='max linex'>line</div>
在这里我的代码,我把全班学生分成line(red)
当我在DIV上单击,但我想它是可逆的,所以当我再次同时点击它在line
再次变成linex(blue)