473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

TR background

I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.

someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)

thanks !
Jun 27 '08 #1
2 1291
Gandalf wrote:
I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.
document.getElementById(TR_id).style.backgroundCol or="red"
>
someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)
document.getElementsByTagName('td')[x].style.backgroundColor="white"

document.getElementsByTagName('td')[x].parentNode.style.backgroundColor="green"
thanks !
Mick
Jun 27 '08 #2
On Apr 14, 9:50 pm, Gandalf <goldn...@gmail.comwrote:
I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.

someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)

thanks !
OK don't pay etention to this message TR can be reached by javascript
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
5
by: proximus | last post by:
Hi, I am trying to change the background of table TD's. The problem is that I have no access to the HTML code. SO I am trying to alter this using Javascript/DOM in an external .js file. I...
3
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in...
1
by: nicky77 | last post by:
Hi, I've created a nav bar using a background image for rollover effects. Everything works as I had hoped, however, for some reason it seems that an area of whitespace (the same size of the...
2
XedinUnknown
by: XedinUnknown | last post by:
Hi! I am new to this forum, but not new to web design and programming. Nevertheless, I have never tried to use PNG so extensively in my pages. here's the problem. First, I have found that the...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
19
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
2
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.