Here is the HTML code snippet I'm working with:
<div id="contentapp">
<input type="radio" name="menu" id="interest" checked>
<input type="radio" name="menu" id="about">
<div id="tab">
<label for="interest">Interest</label>
<label for="about">About</label>
</div>
<div id="content">
<article class="interest">
Interest
</article>
<article class="about">
About
</article>
</div>
</div>
And this is the CSS styling:
#contentapp article {
display: none;
}
#contentapp input#interest:checked ~ article.interest{
display: block;
}
I am facing an issue where I need to show the content blocks when the radio button is clicked, but it's not working correctly. Any suggestions on how to achieve this functionality in the correct way?