<html>
<head>
<title> new document </title>
<meta content="text/html; charset=utf-8" />
<script src="jquery/jquery-2.2.4.min.js"> </script>
<style type="text/css">
.c1{
color: red;
}
</style>
</head>
<body>
<div id="div" class="c1">hello world</div>
<button id="button"> click me</button>
</body>
<script type="text/javascript">
$("#button").on("click", function(){
$("#div").toggleClass('c1');
});
</script>
</html>
如图所示,点击切换样式的作用,我目前了解的不多,可能还有更多用法