| 
 
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| spas 
 
 
 Joined: 12 Oct 2004
 Posts: 3
 
 
 | 
			
				|  Posted: Tue Oct 12, 2004 3:21 pm    Post subject: How to change a link text background color with JavaScript? |   |  
				| 
 |  
				| 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 |  |  
		|  |  
		| administrator Site Admin
 
 
 Joined: 01 Oct 2004
 Posts: 183
 
 
 | 
			
				|  Posted: Tue Oct 12, 2004 3:26 pm    Post subject: |   |  
				| 
 |  
				| 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 |  |  
		|  |  
		| spas 
 
 
 Joined: 12 Oct 2004
 Posts: 3
 
 
 | 
			
				|  Posted: Tue Oct 12, 2004 4:27 pm    Post subject: |   |  
				| 
 |  
				| Thanks  |  |  
		| Back to top |  |  
		|  |  
		| Missie 
 
 
 Joined: 06 Feb 2006
 Posts: 25
 
 
 | 
			
				|  Posted: Tue Feb 07, 2006 8:16 pm    Post subject: |   |  
				| 
 |  
				| Cool this will come in handy.  |  |  
		| Back to top |  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |