ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to change a link text background color with JavaScript?

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS
View previous topic :: View next topic  
Author Message
spas



Joined: 12 Oct 2004
Posts: 3

PostPosted: Tue Oct 12, 2004 3:21 pm    Post subject: How to change a link text background color with JavaScript? Reply with quote

I'm trying to change a link text background color with JavaScript without any success. Can anybody help me and show me how to do that?
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Tue Oct 12, 2004 3:26 pm    Post subject: Reply with quote

You can do that easily with CSS. Just add the following code into the header section of your HTML file:

Code:

<style>
a {
  color: #FF0000;
  background-color: #FFFFFF;
}

a:hover {
  color: #FF0000;
  background-color: #00FF00;
}
</style>

_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
spas



Joined: 12 Oct 2004
Posts: 3

PostPosted: Tue Oct 12, 2004 4:27 pm    Post subject: Reply with quote

Thanks Razz
Back to top
View user's profile Send private message
Missie



Joined: 06 Feb 2006
Posts: 25

PostPosted: Tue Feb 07, 2006 8:16 pm    Post subject: Reply with quote

Cool this will come in handy. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial