0

is there a possibility without using javascript to change a child-element of another parent when a radio button is :checked?

<div id="wrapper" class="clearfix">
  <label class="choice leftChoice">
    <input type="radio" id="choice1" checked="checked" name="choices" value="1">
    <span class="checkmark">Choice 1</span>
  </label>
  <div class="choice_arrow">
    <div class="bullet">
      <span class="fa fa-chevron-left"></span>
    </div>
  </div>
  <label class="choice rightChoice">
    <input type="radio" id="choice2" name="choices" value="2">
    <span class="checkmark">Choice 2</span>
  </label>
</div>

So if Choice 1 or 2 is :checked, i want to affect the choice_arrow's bullet.

jsFiddle Demo: https://jsfiddle.net/rngd31fw/

Firehold
  • 15
  • 2
  • No, that is not possible without Javascript. The only form of "parent" selecting you can have without Javascript is using SCSS' [@at-root](https://sass-lang.com/documentation/at-rules/at-root), but it has lots of limitations. – Diego Fortes Mar 27 '20 at 01:20
  • Check out [this](https://stackoverflow.com/a/4502693/10831896) answer, might be helpful. – ajmnz Mar 27 '20 at 02:02

0 Answers0