企业🤖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> ```