JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div class="div1">
<span id="hover">hover me</span>
<div class="another_txt">
Another text
</div>
</div>
<div class="div2">
<span id="target">How to change this text color on div1 span hover?</span>
</div>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
</body>
CSS
.div1 span:hover ~ .another_txt{
color: red
}
JavaScript
$(document).ready(function() {
$("#hover").hover(function() {
$("#target").css("color", "red");
})
})