By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

changing the links style/status dynamically

P: 25
Hi,
My html has

[HTML]<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementList.do?year=2008">
2008
</a>&nbsp; | &nbsp;</td>
<td class="gold">
<a id = "2007" title="2007" href="../announcementList.do?year=2007">2007 </a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a>&nbsp; | &nbsp;
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementList.do?year=all">All </a>
</td>
</tr>
</Table>
[/HTML]

my style sheet has

Expand|Select|Wrap|Line Numbers
  1. .gold {
  2.     color: #877514;
  3. }
  4.     .gold A:link {COLOR: #877514;    TEXT-DECORATION: none }
  5.     .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
  6.     .gold A:hover {COLOR:red;    TEXT-DECORATION: underline; }
  7.     .gold A:active {COLOR: #877514;    TEXT-DECORATION: none }
  8.  
  9.  
when i am doing a mouse over on the links its changing to red and underline is displaying,on clicking any link i need to change the colour of the link from to
red colour(say i clicked 2008)
once again if i click 2007 the colour of 2007 should change to red and my 2008 back to #877514 colour.

how can i do this

help me out
Thanks in advance...
Oct 9 '08 #1
Share this Question
Share on Google+
4 Replies


acoder
Expert Mod 15k+
P: 16,027
This is not possible with CSS, but you can use JavaScript. If so, I can move this thread to the JavaScript forum for you.
Oct 9 '08 #2

P: 25
yes can move to javascript forum


This is not possible with CSS, but you can use JavaScript. If so, I can move this thread to the JavaScript forum for you.
Oct 9 '08 #3

P: 25
hi
My html is:


[HTML]<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementList.do?year=2008">
2008
</a>&nbsp; | &nbsp;</td>
<td class="gold">
<a id = "2007" title="2007" href="../announcementList.do?year=2007">2007 </a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a>&nbsp; | &nbsp;
</td>
<td class="gold">
<a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a>&nbsp; | &nbsp;
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementList.do?year=all">All </a>
</td>
</tr>
</Table>
[/HTML]

my css



Expand|Select|Wrap|Line Numbers
  1.    1. .gold {
  2.    2.     color: #877514;
  3.    3. }
  4.    4.     .gold A:link {COLOR: #877514;    TEXT-DECORATION: none }
  5.    5.     .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
  6.    6.     .gold A:hover {COLOR:red;    TEXT-DECORATION: underline; }
  7.    7.     .gold A:active {COLOR: #877514;    TEXT-DECORATION: none }
  8.    8.  
  9.  

when i am doing a mouse over on the links its changing to red and underline is displaying,on clicking any link i need to change the colour of the link from to
red colour(say i clicked 2008)
once again if i click 2007 the colour of 2007 should change to red and my 2008 back to #877514 colour.

how can i do this

help me out
Thanks in advance...
Oct 9 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Moved to the JavaScript forum and merged with the thread you've posted here.

Please use code tags when posting code. See How to ask a question.

Moderator.
Oct 9 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.