On my HTML page, I have two span tags that display identical content but are nested in a div with different class names:
<div class='class1'>
<span class='test-icon'>1</span>
</div>
<div class='class2'>
<span class='test-icon'>2</span>
</div>
Is there a way to show only one <span>
at a time based on the nested class? For example, I've attempted using
div.class1 span.test-icon {display: none}
, but it hides both spans.