473,486 Members | 2,394 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Change backgroundImage to bgColor

1 New Member
I have this :
<td id="tdBlueBottom" style="BACKGROUND-IMAGE: url(../images2/BlueBottom.gif); BACKGROUND-REPEAT: repeat-x"
height="20">
</td>

I create function in Javascript :
if(tdBlueBottom!=null)
{
tdBlueBottom.style.backgroundImage ="";
tdBlueBottom.bgColor="#ffffff";
}

but it's not work ..... :-( :-(

What can i do ????

Thank you
Jul 2 '07 #1
4 1391
improvcornartist
303 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. if(tdBlueBottom!=null)
  2. {
  3.     tdBlueBottom.style.backgroundImage ="";
  4.     tdBlueBottom.bgColor="#ffffff";
  5. }
  6.  
You might try getElementById.

Expand|Select|Wrap|Line Numbers
  1. if(tdBlueBottom!=null)
  2. {
  3.     document.getElementById("tdBlueBottom").style.backgroundImage ="";
  4.     document.getElementById("tdBlueBottom").bgColor="#ffffff";
  5. }
  6.  
Jul 2 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
You might try getElementById.
And also style.backgroundColor instead of bgcolor.
Jul 2 '07 #3
Romulo NF
54 New Member
And also style.backgroundColor instead of bgcolor.
I believe hes thinking in the attribute BGCOLOR that some people put directly in the tags (like <body bgcolor="#000">)

But Acorder is right, if you wanna change it use the style.backgroundColor (or just style.background) instead of bgcolor!
Jul 2 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
I believe hes thinking in the attribute BGCOLOR that some people put directly in the tags (like <body bgcolor="#000">)
You're right. It's easy to make that mistake.
Jul 2 '07 #5

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

Similar topics

1
2461
by: Martin Nadoll | last post by:
Hello, is it possible to change the bg-Image of a <td>-tag onMouseOver? maybe with javaScript or with css? Thzankis for any help, Martin Nadoll
2
5276
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
7
4827
by: Keith Smith | last post by:
How can I change the background IMAGE (not just color) of a CELL in a table? I know that I can do this using CSS, but I really need to be able to do it using JavaScript. Anyone know how? Must...
2
3187
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
0
4652
by: Ken Lee | last post by:
Hi all, I'm sort of very new to C# and haven't programmed in OO for a while. I'm trying to override the backgroundimage to the tabcontrol but it just doesn't seem to want to do it, can someone...
1
2944
by: John | last post by:
Hello all, I was wondering, does this property really exist in VB.NET 2003? Because it's listed in Intellisense, but setting it doesn't seem to have the slightest effect on the visual look of...
1
4678
by: VB Programmer | last post by:
I am trying to check which image is currently the BackgroundImage (VB.NET 2005). Can you help me out? Me.BackgroundImage.ToString doesn't work. Here's the sample code... Select Case...
6
3715
by: acord | last post by:
Hi, I want to change the background color of a ul/li row, but the following code is not working as I expected. It works in <table><tr>... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
2
3786
by: Jim | last post by:
How can I use JavaScript to change a background image in a table cell? Here's the code for the cell <td width="338" valign="top" background="../images/ LEC_Q1.jpg"><div...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.