I'm trying changing a CSS class property by checking a checkbox, but it doesn't work... Can you help me?
My code:
<body>
<style>
#test:checked~#title {
display: none;
}
.reverse-flexbox {
display: flex;
flex-direction: column-reverse;
align-items: flex-start;
}
</style>
<div>
<div class="reverse-flexbox">
<h1 id="title">Just a text</h1>
sky is blue
</div>
<div class="reverse-flexbox">
<h1 id="title">Just a text</h1>
i like stackoverflow
</div>
<input type="checkbox" id="test" />
<h1 id="title">Just a text</h1>
<div>Something else</div>
</div>
</body>
</html>