js实现滑块选择功能
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
.item{
height: 40px;
width:20px;
margin: 0 1px;
background-color: bisque;
display: block;
}
.box{
display: flex;
}
.active{
background-color: #000;
}
</style>
<body>
<div class="box">
<span class