Michael M. said:
The one thing I can't seem to figure out is how to retrieve the currently selected <option> from a <select>. If I could do that, I'm pretty sure I could show/hide the other <select>s based on that using the general sibling selector (~).
You can't with CSS.
However, you could use a sheet worker to get the value of the attribute backing the select, and set the value of a checkbox or radio button (which you could hide) based on that value, and use the input's :checked pseudo-selector to show/hide other selects in CSS.
Or, even simpler, if you named the checkboxes/radio buttons the same as the first select (with each having the value of one of the options), Roll20 will propagate the attribute value to the checkboxes/radio buttons for you. For example:
<select name="attr_example">
<option value="1">The first option</option>
<option value="2">The second option</option>
</select>
<input type="radio" name="attr_example" class="sheet-hidden-radio sheet-first-option" value="1">
<input type="radio" name="attr_example" class="sheet-hidden-radio sheet-second-option" value="2">
<select name="attr_example-1" class="sheet-sub-option sheet-first-option">
<option value="1">First option's first sub-option</option>
<option value="2">First option's second sub-option</option>
</select>
<select name="attr_example-2" class="sheet-sub-option sheet-second-option">
<option value="1">Second option's first sub-option</option>
<option value="2">Second option's second sub-option</option>
</select>
.sheet-hidden-radio,
.sheet-sub-option {
display: none;
}
input.sheet-first-option:checked ~ select.sheet-first-option,
input.sheet-second-option:checked ~ select.sheet-second-option {
display: inline;
}