|
-
Jan 23rd, 2003, 02:26 PM
#1
Thread Starter
Lively Member
javascript cell background image
Hi Everyone,
I'm very, very new to javascript, but I want to access a cell's background image to change it dynamically. I believe it has something to do with the style property, but I cannot seem to find it. If anyone could help me, I'd appreciate it.
By the by, I'm trying to access the property through this manner:
document.getElementsByName("TestCell")[0].style
I can change the background COLOR, but not an image that is placed there. Kind of odd and I know it's possible, but I don't know it.
Thank you if anyone can help me.
-
Jan 23rd, 2003, 02:32 PM
#2
Frenzied Member
Code:
document.getElementById('TestCell).style.background = '#ff0000';
or you can use getElementByName ... i just always use Id for some reason (i put both in my element though to be safe).
Hope that helps
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 23rd, 2003, 02:33 PM
#3
Thread Starter
Lively Member
I know how to change the color, not a background image. How do you change a background image for a cell???
-
Jan 23rd, 2003, 02:37 PM
#4
Frenzied Member
lol... guess i need to learn how to read.
Code:
document.getElementById('TestCell).style.backgroundImage = 'url(img/img.gif)';
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 23rd, 2003, 02:42 PM
#5
Thread Starter
Lively Member
Thank you, I appreciate it greatly. I should have figured it would have been that.
-
Jan 23rd, 2003, 02:52 PM
#6
Frenzied Member
Not a problem.
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 24th, 2003, 05:33 AM
#7
Frenzied Member
By the way Mike, don't know if you know this already, but it's good that you use ID as NAME is gone in XHTML for most elements.
-
Jan 24th, 2003, 09:50 AM
#8
Frenzied Member
Originally posted by Rick Bull
By the way Mike, don't know if you know this already, but it's good that you use ID as NAME is gone in XHTML for most elements.
I knew there was some reason
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|