Say you want .generic to change background color when you click it. You can easily do that with
$(".another").css("backgroundColor") ///returns value of .another's bgc
If you did this in CSS you would have to know what .another’s background color is ahead of time, but with JS, no matter how many times you change .another’s background color dynamically, regardless of method, every time you click .generic it will always assign .another’s background color to .unrelated.
Related pen: https://codepen.io/jx2bandito/pen/MmVXdV
For simplicity we’re only talking background color but the sky’s the limit here.