<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
相关推荐
xixixi7777739 分钟前
了解一下Sentry(一个开源的实时错误监控平台)Keely402851 小时前
学习编写chrome插件:Hello World 扩展hhcccchh2 小时前
学习vue第三天 Vue 前端项目结构的说明卷福同学2 小时前
【AI编程】用Codebuddy+lighthouse开发AI年龄模拟网站源力祁老师2 小时前
Odoo 19 制造与会计集成深度解析iFlow_AI2 小时前
iFlow CLI Hooks 「从入门到实战」应用指南Maybyy3 小时前
Chart.js图标绘制工具库漂流瓶jz3 小时前
SourceMap数据生成核心原理:简化字段与Base64VLQ编码桜吹雪3 小时前
手搓一个简易Agent诸葛老刘3 小时前
前端 css中的函数