<DIV class="middle">
<div class="containerTarget">
<span class="hover-target1" οnclick="btn(1);">韵达 </span>
<span class="hover-target2" οnclick="btn(2);">中通 </span>
<span class="hover-target3" οnclick="btn(3);">圆通 </span>
</div>
</DIV>
function go_savebtn(e) {
if (e == '1') {
if (document.querySelector(".hover-target1")) {
document.querySelector(".hover-target1").className = 'hover-static1'
}
else {
document.querySelector(".hover-static1").className = 'hover-target1'
}
} else if (e == '2') {
if (document.querySelector(".hover-target2")) {
document.querySelector(".hover-target2").className = 'hover-static2'
}
else {
document.querySelector(".hover-static2").className = 'hover-target2
}
} else if (e == '3') {
if (document.querySelector(".hover-target3")) {
document.querySelector(".hover-target3").className = 'hover-static3'
} else {
document.querySelector(".hover-static3").className = 'hover-target3'
}
}
}
.hover-target1,
.hover-target2,
.hover-target3 {
cursor: pointer;
background-color: #fff(64, 158, 255, 1);
color: #000;
}
.hover-static1,
.hover-static2,
.hover-static3 {
cursor: pointer;
background-color: rgba(64, 158, 255, 1);
color: white;
}
.hover-target1:hover,
.hover-target2:hover,
.hover-target3:hover {
cursor: pointer;
background-color: rgba(64, 158, 255, 1);
color: white;
border-radius: 5px;
border: 1px solid #ccc;
width: 136px;
height: 40px;
}
html button 按钮单选且 高亮
突然暴富的我2024-12-04 15:19
相关推荐
RobinDevNotes1 小时前
从 Electron 到 GPUI,9 个跨平台桌面方案该怎么选程序员大阳1 小时前
HTML+CSS+JS对话式实战(6)-学生端查看活动功能开发jay神2 小时前
基于 YOLOv8 的轴承缺陷检测(Web 版)jay神2 小时前
基于 YOLOv8 的森林火灾检测系统(Web 版)code2cat2 小时前
HTML基础篇之第一张网页:从index.html到浏览器里的任务清单miss3 小时前
AI 改完不敢上线?OpenSpec 规约驱动开发实战AiMan3 小时前
腾讯ima还是不可以导出左侧所有对话,只能单条导出,方法不对吗去伪存真3 小时前
并发量一高就装死?Agent 全链路“防猝死”手册Moment3 小时前
AI 编程时代,聊聊我的 Mac mini 双屏桌面AiMan4 小时前
先确认能不能一次把Microsofat Copilot所有内容打包一个文件导出