I am having trouble trying to figure out how I can make a text box change content depending on what link is being hovered over. I can get it to work with which ever one is closest to the div but the other links seem to have no effect. I do not however want to have text being inserted in between the links nor do I want to create several text boxes. My main goal is to have the links always in the same place and when you hover over them a text box underneath will display the correct content.
Here is some code and a JSFiddle I threw together to help better illustrate my question: JSFiddle
HTML:
<a class="one" href="#">one</a>
<a class="two" href="#">two</a>
<a class="three" href="#">three</a>
<div class="element">hello</div>
CSS:
.element {
display: none;
}
a:hover + .element {
display: block;
}