I have a programming idea that involves the following: * Clicking on Span 1 will reveal Span 2 and disable Span 1. * Clicking on Span 2 will reveal Span 1 and disable Span 2.
Below are the codes I have written, but I am not sure if they are correct. Any assistance would be greatly appreciated.
CSS
body {
display: block;
}
.span1:focus ~ .span2 {
display: none;
}
.span2:focus ~ .span1 {
display: block;
}
HTML
<span class="span1" tabindex="0">Span 1</span>
<span class="span2" tabindex="0">Span 2</span>