需要设置3个类来实现点击颜色的切换
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<style>
label#lbl-1 {
background: #6756ea;
width: 20px;
height: 20px;
display: block;
float: right;
border-radius: 50%;
margin: 16px 10px 0px 0px;
}
label#lbl-2 {
background: #ea569a;
width: 20px;
height: 20px;
display: block;
float: right;
border-radius: 50%;
margin: 16px 10px 0px 0px;
}
label#lbl-3 {
background: #f1c85f;
width: 20px;
height: 20px;
display: block;
float: right;
border-radius: 50%;
margin: 16px 10px 0px 0px;
}
</style>
<body>
<div class="head-info">
<label id="lbl-1" οnclick="this.id='lbl-2'" οnmοuseοut="this.id='lbl-1'"> </label>
<label id="lbl-2" οnclick="bb()"> </label>
<label id="lbl-3" οnclick="cc()" > </label>
</div>
</body>
</html>