I am faced with a scenario where I have three boxes:
div {
display: inline-block;
width: 100px;
height: 100px;
border: 1px solid black;
cursor: pointer;
}
div.selected,
div:hover {
background-color: red;
color: white;
}
<div>A</div>
<div>B</div>
<div>C</div>
I would like to click on one of the boxes and as I move my mouse while holding it down, the div should be assigned the "selected" class. Is this achievable?
Thank you.