<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/jquery.js"></script>
<style>
.show1{
width: 100px;
height: 100px;
background-color: yellow;
}
.show2{
width: 100px;
height: 100px;
background-color: green;
}
</style>
</head>
<body>
<div class="show1">
</div>
<script type="text/javascript">
$(function () {
$("div").on("click",function () {
$(this).toggleClass("show2");
})
})
</script>
</body>
</html>
效果: