Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Programmatically modify anchor
10-10-2003, 05:36 PM #1
- Join Date
- Sep 2002
- Cary, North Carolina, USA
- Thanked 0 Times in 0 Posts
programatically modify anchor
I have a popup with a list of anchors that function like a 'select'.
The anchor color changes via a.myclass:hover correctly. However, when an anchor is selected, I want to set the a.myclass:visited to match the hover values, so that it looks selected. When a different anchor is selected, I want to unset the previous anchors visited colors and set the current anchors visited colors. The reason I'm not using a 'select' is two fold.
1. The select that I need is a dropdown tree (with icons) like explorers address field.
2. A select shows ontop of other objects, like DIVs used in menus.
The anchor mechanism does exactly what I want, except I need to emulate the 'current selection' mechanism.
10-11-2003, 10:46 PM #2
just set up another class and swap it.
if (currselect) document.getElementById(currselect).className='myclass';
Assuming the the link is something like:
<a id="someid" href="blah.com" onClick="setsel(this.id)"> click </a>