I have the following code:
<div id="nav">
<ul>
<li id="tabOne" class="first current"><a href="./CS1.html" target="SheetView">Page One</a></li>
<li id="tabTwo"><a href="./CS2.html" target="SheetView">Page Two</a></li>
<li id="tabThree"><a href="./CS3.html" target="SheetView">Page Three</li>
<li id="tabFour"><a href="./CS4.html" target="SheetView">Page Four</a></li>
<li id="tabFive"><a href="./CS5.html" target="SheetView">Page Five</a></li>
<li id="tabSix"><a href="./CS6.html" target="SheetView">Page Six</a></li>
</ul>
This loads the selected page into an iframe named "SheetView." What I need to do is use JavaScript to alter the class when an option that isn't the currently selected on is clicked. I should say that I have the current class already setup in my CSS. I just have no way to trigger it.
I thought adding an onlick event to the <UL>
up there and calling onclick="Javascript:changeCurrent();"
but there is the problem (four actually):
- Is
<ul onclick="JavaScript:changeCurrent();>
where I need to have the event? - What is the resulting JavaScript to make the change happen?
- How can I cause the first option to be set as current by default?
- Is there a way to keep the currently selected option from being an active link?
I found a few different examples but I couldn't tailor them to work for me. Any help would be most appreciated.