There is such a piece of layout:
<div class="1"> <a href="#">Some link</a> <span><input class="selected/unselected"></span> </div>
I wanted to ask how you can choose a div class 1 if he has an insideted select inside (that is, if inside a div is inside an selected, then the div should also become selected), and remove the class if the input becomes unselected. Inputs change their class if you click on another button on the site.