There are three blocks, each of which should be highlighted, when you hover the mouse. Block number 1 is highlighted by default. When you hover on blocks 2 and 3, the selection should be removed from block 1 and connected to the selected block.
https://codepen.io/magnu/pen/KQMwMZ
I do not understand how to achieve this with jquery.
$('.block').hover(function () { if ($('.block').not('.active')) { $(this).toggleClass('active') } });