💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> *{ padding: 0; margin: 0; } #hd{ overflow: hidden; margin: 100px 300px; border: 1px solid #eee; width: 100px; } #hd li{ list-style: none; width: 50px; height: 30px; line-height: 30px; text-align: center; font-size: 13px; float: left; background: #eee; } #hd li.cur{ background: deepskyblue; color: white; } </style> </head> <body> <ul id="hd"> <li class="cur">开</li> <li>关</li> </ul> <script src="jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> $("#hd li").click(function(){ //$(this).addClass('cur').siblings().removeClass('cur'); $("#hd li").toggleClass('cur'); }) </script> </body> </html>