<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
相关推荐
sorryhc5 分钟前
钉钉红包性能优化之路袁煦丞25 分钟前
你的在线相册管理专家Piwigo:cpolar内网穿透实验室第487个成功挑战꧁༺摩༒西༻꧂30 分钟前
Python生成日历导出ExcelMintopia2 小时前
计算机图形学的奇幻之旅:第三天探索Mintopia2 小时前
Three.js 物理材质:打造 3D 世界的 “魔法皮肤”知识分享小能手2 小时前
Typescript学习教程,从入门到精通,TypeScript 泛型与类型操作详解(二)(17)stark张宇2 小时前
Web - Javascript 函数与DOM、BOM上海张律师3 小时前
组件截图sdk -- screenshot_hm介绍 ##三方SDK##lineo_3 小时前
抛弃陈旧写法,你的uniapp定义globalData的正确姿势(setup语法糖)spionbo3 小时前
Vue 结合 D3 实现可拖拽拓扑图的技术方案及具体应用实例解析