ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` <html> <head> <style type="text/css"> div{width:100px;height:100px;} .red{background:red} .green{background:green} </style> <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <div id="div" style="background:Green;cursor:hand;">click</div> <div class="main red">div class</div> </body> <script type="text/javascript"> $(document).ready(function(){ $("#div").click(function(){ var cls = $(".main").attr("class"); if(cls == "main") $(".main").attr("class", "main red"); else $(".main").attr("class", "main"); }); }); </script> </html> ```