<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
相关推荐
JamSlade42 分钟前
流式响应 sse 系统全流程 react + fastapi为例子徐同保44 分钟前
react useState ts定义类型liangshanbo12151 小时前
React 19 vs React 18全面对比望获linux1 小时前
【实时Linux实战系列】Linux 内核的实时组调度(Real-Time Group Scheduling)Never_Satisfied1 小时前
在 JavaScript 中,删除数组中内容为xxx的元素_菜鸟果果1 小时前
Vue3+echarts 3d饼图rechol2 小时前
类与对象(中)笔记整理Luffe船长2 小时前
前端vue2+js+springboot实现excle导入优化Demoncode_y3 小时前
前端布局入门:flex、grid 及其他常用布局明天最后3 小时前
使用 Service Worker 限制请求并发数