Teamur,
вариант без промежуточного выделения , только по клику
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style>
body {
display: flex;
margin: 0;
height: 100vh;
background: #56bddc;
}
#box {
display: flex;
margin: auto;
box-shadow: 0 0 5px hsla(0, 0%, 0%, .25);
}
.el {
width: 60px;
line-height: 60px;
font-family: consolas;
font-size: 30px;
text-align: center;
cursor: pointer;
background: #fff;
-webkit-user-select: none;
-moz-user-select: none;
}
.el:hover { background: #fece9a; }
.mark { background: #fece9a; }
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var d = document.querySelectorAll(".el"),
a = void 0;
[].forEach.call(d, function(c, b) {
c.addEventListener("click", function() {
if (void 0 == a) a = b;
else {
var c = Math.min(b, a),
e = Math.max(b, a);
a = void 0;
[].forEach.call(d, function(a, b) {
b >= c && b <= e && a.classList.toggle("mark")
})
}
})
})
});
</script>
</head>
<body>
<div id='box'>
<div class='el'>1</div>
<div class='el'>2</div>
<div class='el'>3</div>
<div class='el'>4</div>
<div class='el'>5</div>
<div class='el'>6</div>
<div class='el'>7</div>
<div class='el'>8</div>
<div class='el'>9</div>
<div class='el'>X</div>
</div>
</body>
</html>