JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<body>
<table id="productList">
<tr>
<td><input type="text" value = "1"/></td>
<td><input type="text" value = "1"/></td>
</tr>
<tr>
<td><input type="text" value = "1"/></td>
<td><input type="text" value = "1"/></td>
</tr>
</table>
<script>
$("#productList").on("mousedown", "td", function () {
$("td").css("background", "");
$(this).css("background", "red");
//save from where to start
});
$("#productList").on("mouseover mouseenter mouseover hover", "td", function () {
$(this).css("background", "yellow");
console.log("test");
//update highlighting, modify classes
//this function isn't fired when I click on one of <td> and drag mouse somewhere else
});
</script>
</body>
CSS
#productList td{
border: 1px solid grey;
padding: 0;
}