PDA

View Full Version : Help with current selection


Sayian
02-02-2006, 09:12 PM
Im trying to put togeather a simple list

How can i get the current selected tab to become id="current"?


<ul id="navlist">
<li id="active"><a href="#" id="current">Item one</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
</ul>


So if item 2's url was selected, item 2 would become current?

Pennimus
02-02-2006, 09:27 PM
You need to use javascript or a server side language to get the current URL, and swap out the ID as required based on this. My vote, if you have it enabled on your server, goes to PHP - it's simple to achieve for beginners and the kind of thing that PHP excels at doing with very little code.

Sayian
02-02-2006, 09:46 PM
Thanks so much. I have done this in php.