alexjewell
06-10-2007, 03:30 AM
I have a page with 4 different "tabs". I created a simple onclick event to each link. Here is the html:
<p><a href="#" onclick="poetry.style.display='block'; thoughts.style.display='none'; questions.style.display='none';">Poetry</a> |
<a href="#" onclick="poetry.style.display='none'; thoughts.style.display='block'; questions.style.display='none';">Thoughts</a> |
<a href="#" onclick="poetry.style.display='none'; thoughts.style.display='none'; questions.style.display='block';">Questions?</a></p>
<div id="poetry">Poetry content</div>
<div id="thoughts">Thoughts content</div>
<div id="questions">Questions content</div>
And I have simple css to go along with it:
#poetry{
display: block;}
#thoughts, #questions{
display: none;}
Now, for some reason this isn't working. In FireFox, nothing happens when you click on another tab - Poetry is the only one that will show up. In IE7, all three div's show up in order and clicking on the tabs does nothing. Is there a better way of doing this? What am I doing wrong?
<p><a href="#" onclick="poetry.style.display='block'; thoughts.style.display='none'; questions.style.display='none';">Poetry</a> |
<a href="#" onclick="poetry.style.display='none'; thoughts.style.display='block'; questions.style.display='none';">Thoughts</a> |
<a href="#" onclick="poetry.style.display='none'; thoughts.style.display='none'; questions.style.display='block';">Questions?</a></p>
<div id="poetry">Poetry content</div>
<div id="thoughts">Thoughts content</div>
<div id="questions">Questions content</div>
And I have simple css to go along with it:
#poetry{
display: block;}
#thoughts, #questions{
display: none;}
Now, for some reason this isn't working. In FireFox, nothing happens when you click on another tab - Poetry is the only one that will show up. In IE7, all three div's show up in order and clicking on the tabs does nothing. Is there a better way of doing this? What am I doing wrong?